Jump to ratings and reviews
Rate this book

Pro Bash Programming Second Edition Scripting the GNULinux Shell: Computer Programming

Rate this book
When the shell is given the name of a command to execute, it looks for that name in the directories listed in the PATH variable. This variable contains a colon-separated list of directories that contain executable commands. This is a typical value for $
!"
/
If your program is not in one of the PATH directories, you must give a pathname, either absolute or relative, for bash to find it. An absolute pathname gives the location from the root of the filesystem, such as
/home/chris/bin/hw; a relative pathname is given in relation to the current working directory (which should currently be your home directory), as in bin/hw .
Commands are usually stored in directories named bin, and a user’s personal programs are stored in a bin subdirectory in the $HOME directory. To create that directory, use this mkdir bin
Now that it exists, it must be added to the PATH
PATH=$
For this change to be applied to every shell you open, add it to a file that the shell will source when it is invoked. This will be .bash_profile, .bashrc, or .profile depending on how bash is invoked. These files are sourced only for interactive shells, not for scripts.
Creating the File and Running the Script
Usually you would use a text editor to create your program, but for a simple script like this, it’s not necessary to call up an editor. You can cr

Kindle Edition

Published November 16, 2020

About the author

Bobby Price

8 books5 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
0 (0%)
4 stars
1 (100%)
3 stars
0 (0%)
2 stars
0 (0%)
1 star
0 (0%)
No one has reviewed this book yet.

Can't find what you're looking for?

Get help and learn more about the design.