LDP/LDP/guide/docbook/abs-guide/commentblock.sh

31 lines
670 B
Bash
Raw Normal View History

2002-06-03 14:36:49 +00:00
#!/bin/bash
# commentblock.sh
: << COMMENTBLOCK
echo "This line will not echo."
This is a comment line missing the "#" prefix.
This is another comment line missing the "#" prefix.
&*@!!++=
The above line will cause no error message,
because the Bash interpreter will ignore it.
COMMENTBLOCK
echo "Exit value of above \"COMMENTBLOCK\" is $?." # 0
# No error shown.
# The above technique also comes in useful for commenting out
#+ a block of working code for debugging purposes.
# This saves having to put a "#" at the beginning of each line,
#+ then having to go back and delete each "#" later.
: << DEBUGXXX
for file in *
do
cat "$file"
done
DEBUGXXX
exit 0