Code:while [ true ]; do CY=$(date +%y); CM=$(date +%m); if [ -n "$PY" ] && [ -n "$PM" ]; then echo "Ubuntu ${CY}.${CM} is the worst release ever"; echo "I'm going back to ${PY}.${PM}"; fi; PY="$CY"; PM="$CM"; sleep 182d; done
Cheers for the python stuff. It would have worked for my problem when it matched 21 2 3 because what I didn't really tell you was that every number was a decimal between 0 and 1. But in any case, the reason I was doing that was because I was trying to find the periodicity of the rand() c function which further research tells me is 2^32 ~= 4 billion and I couldn't create a file with 9 billion values (to get the period twice) without my hard drive or grep complaining so either way, it was impractical.
Python would have been even worse really but I guess if I left it long enough, it would have worked. Anyway, those snippets are quite useful for other things so I'll keep this thread in mind.
Thanks everyone!
Bookmarks