Click to See Complete Forum and Search --> : Help with Shell Scripting.
Eggoz
04-21-2003, 02:22 AM
I am trying to assign the varible uid_old to this command: awk -F: '{print $3 }' /etc/passwd | sort -n -u | tail -1. I remember hearing something about trying to pass commands to variables you need a special character or something? Can somebody please show me how to do this as well as the correct syntax for this: user_id = "$uid_old" + 1. This is my first attempt to shell scripting. Any good sites I can get some help from? Thanks.
have a command..user_id=$(expr $uid_old + 1)
bigrigdriver
04-22-2003, 05:21 PM
Do a google search for 'Advanced Bash-scripting Guide' and 'Bash Reference Manual'. They'll get you started.
shadowrider
04-24-2003, 03:24 AM
basics shell scripting (http://www.freeos.com/guides/lsst/)
advanced bash scripting (http://www.tldp.org/LDP/abs/html/)
more scripting (http://www.linuxgazette.com/issue54/okopnik.html)