python - Fish shell script : getting a precise random number -
basically, want greeting message (fish_greeting.fish) display either 1 ascii art or other (a cat or squid). so, need pick random integer. random function in fish doesn't seem take parameters (i.e random(1,4)). made in python, don't know how call fish script.
any idea? fish shell wonderful shell, sadly no documented compared bash (which don't like) , zsh (awesome, not fish)
you can use math
arithmetic. example:
if [ (math (random)'%2') -eq 1 ] squid else cat end
Comments
Post a Comment