Can't decide where to eat? (and you're in the USA, I presume)? Grab the Wheel of Lunch and give it a spin!
I will not publicly admit that I have a shellscript to do the same thing. If I did have such a script, its database would be populated only with restaurants I happened to like, all near my current place of work, and I would be about half way through implementing "attributes" such as "quick" or "inexpensive" -- but only if I had such a script. Of course I don't. Only a computer geek type of person would have such a thing.
I will not publicly admit that I have a shellscript to do the same thing. If I did have such a script, its database would be populated only with restaurants I happened to like, all near my current place of work, and I would be about half way through implementing "attributes" such as "quick" or "inexpensive" -- but only if I had such a script. Of course I don't. Only a computer geek type of person would have such a thing.
no subject
It's really too bad that that script isn't someplace that people could get a copy.
no subject
#!/bin/csh -f
######################################
# Enumerate the potential food choices
######################################
echo "Amarin Thai on Castro" >> /tmp/cj.food.txt
echo "Amici's Pizza on Castro" >> /tmp/cj.food.txt
echo "Armadillo Willy's" >> /tmp/cj.food.txt
##########################################
# Pick a random number, spit out that line
##########################################
# Replace "%s" with %N" on RHEL3 machines.
# %s is seconds since the epoch; %N is nanoseconds and makes a better
# randomizer. (However, it seems always to report an even microsecond.)
# setenv OSVER `head -1 /etc/redhat-release | cut -d ' ' -f 5`
# echo $OSVER
# if ($OSVER == "WS") then
setenv RANDOM_NUM `/bin/date +%N`
setenv RANDOM_NUM `expr $RANDOM_NUM / 1000`
# else setenv RANDOM_NUM `/bin/date +%s`
# endif
# echo $RANDOM_NUM
setenv NUM_LINES `cat /tmp/cj.food.txt | wc -l`
setenv PICK_LINE `expr $RANDOM_NUM % $NUM_LINES`
setenv PICK_LINE `expr $PICK_LINE + 1`
# echo $PICK_LINE
head -n $PICK_LINE /tmp/cj.food.txt | tail -n 1
rm /tmp/cj.food.txt
no subject
no subject
no subject
no subject
no subject
no subject
:-)
no subject