Trying the Recipes
Most recipes provide commands or scripts you can run, or a set of configuration options for a particular program. When trying a recipe, please keep in mind:
Our default shell for recipes is
bash. If you use another shell, you might need different syntax for setting environment variables and other shell-specific things.If you create a Linux shell script (say, “myscript”) in your current directory, but the current directory (“.”) is not in your search path, you can’t run it simply by typing the script name:
$ myscript bash: myscript: command not found
because the shell won’t find it. To invoke the script, specify that it’s in the current directory:
$ ./myscript
Alternatively, you could add the current directory to your search path, but we recommend against this. [Recipe 9.7]
Linux commands may behave differently when run in an interactive shell, a script, or a batch job (e.g., via
cron). Each method may have a different environment (for example, search path), and some commands even are coded to behave differently depending how they are invoked. If a recipe does not behave as you expect in a script, try running it interactively, and vice versa. You can see your environment with theenvcommand, and your shell variables with thesetbuilt-in command.Different Linux distributions may place important binaries and configuration files in locations different from those in our recipes. Programs are assumed to be in your search path. You might need to add directories to your ...