ps -fThe -f option to
psgives you more information about running processes.
|UID||The username of the account that started the process|
|PID||The process ID|
|PPID||The process ID of the parent process|
|STIME||When the process started|
|CMD||The command line that started the process|
sleep 120 & ps -fNotice that the process ID of the parent process that called
ps -fis the process ID of your shell.
sleepprocesses are running
sleep 20 & sleep 20 & pstree -phLook at the bold line of processes, which denotes your shell. You will notice sleep processes running under your bash shell.
cp ~ghoffman/course_files/it244_files/print_positionals.sh .
cat print_positionals.shThe script simply prints the first four tokens on the command line.
./print_positionals.sh foo bar bletchNotice that the first positional parameter printed, 0, is the name of the command.
cp ~ghoffman/course_files/it244_files/print_arg_numbers.sh .
./print_arg_numbers.sh foo bar bletchThe script prints the number of arguments given to it on the command line.
echo $big_appleSingle quotes do not allow you to get the value of a variable.
echo $big_appleThis time it works, because you can use the value of a variable inside double quotes.
city=Boston ; state=MA
echo $city ; echo $state
echo $citycity now has no value.
echo $stateNow state has no value.
declare -r team
team=CelticsYou can't change the value because team is now read only.
chmod 755 ex19.sh
bash ex19.sh > /dev/null
~ghoffman/it244_test/ex19.shWhen the script asks if you are ready for more, hit Return or Enter.