what does this command do?
!/bin/bash
My first script
clear
echo (I don't know what will come after echo , can you help me with that too?)
./hello.shell
what does this command do?
!/bin/bash
My first script
clear
echo (I don't know what will come after echo , can you help me with that too?)
./hello.shell
#!/bin/bash
is called the shebang (you missed the leading #
).
It tells which program will execute your script.
clear
is for clearing screen.
echo
outputs following argument to the standard output (your terminal by default). But you must not surround your string with parenthesis as it's used for grouping command in a sub-shell. If you want to print (...)
, you'll have too use double quotes :
echo "(I don't know what will come after echo , can you help me with that too?)"
./hello.shell
will execute your script after you gave it execute permissions with chmod +x hello.shell
.
Note that commonly used extension for a shell script is .sh
rather than .shell
.
For more, try theses links :
http://mywiki.wooledge.org/BashGuide/
http://www.tldp.org/LDP/Bash-Beginners-Guide/html/
#!/bin/bash
tells to the SO that this file is a script and that bash is the shell that must execute it. So you can found: #!/opt/bin/perl
for perl scripts, #!/bin/csh
for c-shell, #!/bin/zsh
...