echo Go \[Enter] Red \[Enter] Sox [Enter]The greater than symbol, > , that you see after all but the last time you hit Enter is a secondary prompt.
echo The University \[Enter] of Massachusetts \[Enter] at Boston [Enter]
echo Hello \[Space][Enter]The
echocommand does not wait for further input, it prints its argument and you don't get a secondary prompt.
PS1='===> 'Note the single quotes.
echo Go \[Enter] Red \[Enter] Sox [Enter]You should see your new secondary prompt with each new line.
echocommands on the same command line
echo foo; echo bar; echo bletchEach echo command generates its own line of output.
echocommands on the same line
echo Unix; echo is not; echo for the faint of heart
echo; echo This is what is in my home directory:; ls -al ~
cp ~ghoffman/course_files/it244_files/hi_bye.sh .
./hi_bye.sh & ./hi_bye.sh & jobsThe ampersand causes each of the two invocations of hi_bye.sh to run in the background.
jobsis able to report on the two invocations of hi_bye.sh running in the background, because it is running in the foreground.
cp ~ghoffman/course_files/it244_files/print_foo.sh .
cat print_foo.shThis script simply prints the value of the variable foo to Standard Output.
./print_foo.shThe script prints no value for foo, since foo was a local variable defined in your original shell.
exportcommand makes foo a global variable, print_foo.sh can now see this variable in the subshell in which it is run.
dirsto look at the directory stack
dirsIt only lists the current directory.
pushd projTwo directories are now listed.
pushd proj1Three directories are now listed.
popdNow, only two directories are listed, because you poped the previous directory from the stack.
popd > /dev/null; pwdBy redirecting output to /dev/null, you have stopped
popdfrom printing out the directory stack.
pwd, you have displayed your current location without having to wait for a prompt.
chmod 755 ex18.sh
bash ex18.sh > /dev/nullRunning ex18.sh this way will only print error messages.
~ghoffman/it244_test/ex18.shWhen the script asks if you are ready for more, hit Return or Enter.