How to include comments in your shell scripts?

Answers were Sorted based on User's Feedback



How to include comments in your shell scripts?..

Answer / ranjana

# comments

Is This Answer Correct ?    4 Yes 0 No

How to include comments in your shell scripts?..

Answer / rameshs

#!/bin/bash
echo "Say Something"
<<COMMENT1
your comment 1
comment 2
blah
COMMENT1
echo "Do something else"

Is This Answer Correct ?    0 Yes 1 No

How to include comments in your shell scripts?..

Answer / vipul dalwala

To comment multiple lines U can use

: '
comment1
comment2
comment3
'

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More Shell Script Interview Questions

What are the default permissions of a file when it is created?

0 Answers  


Hi, all Scripting professional. Q. I have written script1.sh and calling script2.sh in script1.sh file using bash shell as interpreter and my log in shell also bash shell.My code like Script1 #!/bin/bash echo "My script2 call" . script2.sh Here script2.sh file run successfully but when I have changed my interpreter bash to ksh like #!/bin/ksh Error are comming script2.sh command not found. Guid me how to call other script in our main script.

2 Answers  


What is shell and terminal?

0 Answers  


Hi Friends, I am currently Undergoing Course On Testing.I am Planning To Keep Fake Resume.Can any One tell me the ways to Prepare i.e, Real Time experience For Manual Testing. With Regards, Vikram

1 Answers  


what are command line arguments? what is the need of those?

1 Answers   Flipkart,


How to redirect both standard output and standard error to the same location?

0 Answers  


on “sed” command EmpData(Sample Database) 1122|j.b. saxena |g.m. |account |12/12/52|6000 2233|n.k. gupta |d.g.m |sales |31/12/40|9000 4545|anil agarwal |director |account |06/07/47|7500 5656|lalit choudhury |executive|marketing|07/09/50|5000 1265|chanchal singhvi|g.m. |admin |12/09/63|6000 0110|shyam saksena |chairman |marketing|12/12/43|8000 5566|jai sharma |director |account |23/12/89|7000 7733|jayant |d.g.m |sales |29/02/70|6000 1. From the above database substitute the delimiter of first 3 lines with “ : “ 2. From the above database substitute the delimiter with “ : ” 3. Insert the string “ XYZ Employees” in the first line. 4. Store the lines pertaining to the directors, d.g.m and g.m into three separate files. 5. Using address store first 4 lines into a file Empupdate. 6. Find the pattern “account” in the database and replaces that with “accounts”. 7. Select those lines which do not have a pattern “g.m”. 8. Insert a blank line after every line in the database.

0 Answers  


Print the 10th line without using tail and head command.

0 Answers  


How to get the last line from a file using just the terminal?

0 Answers  


write a non recursive shell script that accepts any number of arguments and prints them in the reverse order

3 Answers  


What is scripting autism?

0 Answers  


Is shell scripting easy to learn?

0 Answers  


Categories