Last active
January 1, 2016 17:49
-
-
Save serverwentdown/8179670 to your computer and use it in GitHub Desktop.
Read the file please...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# fortune.sh 10 print <- prints 10 fortunes on paper. | |
# fortune.sh 12 <- prints 12 fortunes to cat. | |
printf "" > tmp.txt | |
for i in $(eval echo {0..$1 }) | |
do | |
printf "\n" >> tmp.txt | |
fortune >> tmp.txt | |
printf "\n -------&-------" >> tmp.txt | |
done | |
printf "\n\n Some fortune sent to you from Ambrose Chua" >> tmp.txt | |
if [ "$2" = "print" ] | |
then | |
lp -o number-up=2 tmp.txt | |
else | |
cat tmp.txt | |
fi | |
printf "\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment