When you are creating a shell script you can use a file to do all of the commands you would do at the terminal prompt. $
At the top of the file you need to put where to execute the script language. We are using bash for the class.
#!/bin/bash
# lets you do comments that are not read by the shell.
# no put all of the commands you want to run on the lines below.
# for instance
mkdir dogs
cd dogs
touch rover
touch fido
touch spot
After you are done writing your shell script save the file with the extension .sh
now you can run your shell script at the terminal prompt.
[root@local]$ sh yourshellscriptname.sh
No comments:
Post a Comment