Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: pretty easy thing but too hard for me! (random array element)



> Would you mind sharing that awesome off-list reply
> with the rest of us?

If you want complete awesomeness (sorry, didn't realize it was
originally off-list) you at least need all of the files:

#!/usr/bin/ruby -w

Fromat = "http://www.qwantz.com/comics/comic2-%02i.png";

2.upto(1072) do |i|
  `wget #{sprintf(Fromat, i)}`
  sleep 1
end

and then do this in your .zshrc

if [[ -x ~/personal/dino ]]; then
  dinoray=( ~/personal/dino/* )
  alias dino='feh $dinoray[$RANDOM%$#dinoray+1]'
fi

and then you can type dino and get a random comic!

-- 
-fREW



Messages sorted by: Reverse Date, Date, Thread, Author