LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   shell script variables (https://www.linuxquestions.org/questions/programming-9/shell-script-variables-488718/)

Gary_Menegon 10-02-2006 09:19 AM

shell script variables
 
I have then following script:
#!/bin/bash
#calendar2 - try to automate calendar
$1
for NUM in 1 2 3 4 5 6 7 8 9 10 11 12
do
cal "$NUM" "$1"
echo
sleep 5
done
echo
exit 0

This sort of works, but what I really what is to be prompted to enter a year to display entire year calendar. Also is there a complied list of common script commands, such as READ, ECHO, FOR, WHILE and so forth?

Thankyou in advance!
sincerely,
Gary

unSpawn 10-02-2006 09:28 AM

what I really what is to be prompted to enter a year to display entire year calendar.
Code:

echo "Gimme year, and make it snappy:"; read year; echo "got variable \$year=$year"

is there a complied list of common script commands
"man bash" should do and here's some Bash scripting guides:
http://www.tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html
http://www.tldp.org/LDP/Bash-Beginne...tml/index.html
http://www.tldp.org/LDP/abs/html/


All times are GMT -5. The time now is 04:17 PM.