When you want to comment out multiple lines at once
<<Comment out statement
Comment out statement
Surround with.
There was no problem with sh and bash, but I got an error in csh. Here's what worked.
Hello_1.csh
#!/bin/csh
echo "Takato : Hello, Nadeshiko!"
echo "Nadeshiko : Hello Takato."
:<< 'COMMENT_OUT'
echo "Takato : Hello Riichiro, too."
echo "Riichiro : ... Hello"
'COMMENT_OUT'
Execution result
Takato : Hello, Nadeshiko! Nadeshiko : Hello Takato.
Hello_2.csh
#!/bin/csh
echo "Takato : Hello, Nadeshiko!"
echo "Nadeshiko : Hello Takato."
<< COMMENT_OUT
echo "Takato : Hello Riichiro, too."
echo "Riichiro : ... Hello"
COMMENT_OUT
Execution result
Takato : Hello, Nadeshiko! Nadeshiko : Hello Takato. Invalid null command.
** Conclusion **
:<< 'Comment out statement'
'Comment out statement'
The following seems to be the point.
** 1. Put ": (colon)" at the beginning of the sentence **
** 2. Enclose the commented out string in single quotes **
It worked fine with sh and bash.
The conversation is from my favorite game, CLOCK ZERO.
Riichiro who takes an unfriendly attitude toward Takato, a transfer student who calls out to his childhood friend Nadeshiko, is cute.
Recommended Posts