Reputation: 5982
Suppose you have the following script:
# My comment line 1
# My comment line 2
# My comment line 3
echo "My script"
cd $MY_PATH
./anotherScript.ksh
Is there any command to show:
# My comment line 1
# My comment line 2
# My comment line 3
Alternatively, I could write a script to detect the first block of comments.
Thanks
Upvotes: 0
Views: 9537
Reputation: 2339
This will output your file to the grep command which will print each line with a "#"
echo "My script" | grep "#"
EDIT I'M DUMB
all you need to do is grep '#' file
if I'm understanding correctly this time.
Upvotes: -1