if [ -f ~/somefilename ]; then
source ~/somefilename
fiIn this example the script checks to see if a file named "somefilename" exists in my home/root directory. If it "somefilename" exists then it sources/executes the content of that file as a script.
When is this useful? I'll show you in the following post: Turn on Git Autocompletion
Links
Bash Scripting: How to
Bash Beginners Guide
Advanced Bash Scripting
No comments:
Post a Comment