Tutorial: The best tips & tricks for bash, explained
More bash tricks, MORE!
Tutorial: The best tips & tricks for bash, explained
More bash tricks, MORE!
Working Productively in Bash’s Vi Command Line Editing Mode (with Cheat Sheet)
There always is something new to learn!
Bash Shortcuts For Maximum Productivity
Great post! I really don’t feel I know Bash at all when I first read it ;)
$cat out
if [ $# -eq 0 ]
then
echo "Usage: out [-v] filenames..." 1>&2
exit 1
fi
if [ "$1" = "-v" ]
then
shift
less -- "$@"
else
cat -- "$@"
fi
In out the
--arguments to cat and less tells these utilities that no more options follow on the command line and not to consider leading hyphen (-) in the following list as indicating options. Thus--allows you to view a file with a name that starts with a hyphen…--argument works with all Linux utilities that use the getopts builtin… This argument is particularly useful when used in conjunction with rm to remove a file whose name starts with a hyphen (rm -- -fname)…
A Practical Guide to Linux Commands, Editors and Shell Programming (p. 442)
find ~ -name '* *' | while read FILE
do
echo "$FILE rocks."
done