June 2017
Beginner
502 pages
11h 26m
English
This represents a comment. Each line beginning with # is taken as a comment and not interpreted by the shell. Let's have a look at the following script:
#!/bin/bash# I am a comment at the beginning of a line'ls # I am a comment after a command#I am a comment preceeding a command and so it is not interpreted ps
The first pound sign is not really a comment, but it is associated to the following exclamation mark and is interpreted as a sha-bang. The second line shows a typical comment line, the third a comment after a command, the fourth line is still a comment, and the ps command is not interpreted and executed. Let's run it:
zarrelli:~$ ./comment.sh* 1 2 3 comment.sh
We see the output of the ls command, but not of
Read now
Unlock full access