Advanced Bash-Scripting HOWTO: A guide to shell scripting, using Bash | ||
---|---|---|
Prev | Chapter 3. Tutorial / Reference | Next |
Commands within backticks generate command line text.
The output of commands within backticks can be used as arguments to another command or to load a variable.
rm `cat filename`
# "filename" contains a list of files to delete.
textfile_listing=`ls *.txt`
# Variable contains names of all *.txt files in current working directory.
echo $textfile_listing |
z=`expr $z + 3` |
z=$(($z+3)) let z=z+3 let "z += 3" #If quotes, then spaces and special operators allowed. |