The Helloword of the shell
Cd/bin
Ls-l | Find-name SH
Ls-l | FIND-NAMD Bash
Ls-l | Grep-r sh sh is actually pointing to dash
lrwxrwxrwx 1 root root 4 2014-12-11 03:13 sh, dash
Ls-l | Grep-r Bash
CD ~
mkdir Shell
VI hello.sh
#!/bin/bash//fixed notation, equivalent to introducing
Echo ' Helloword '
Ls-l
sudo chmod u+w hello.sh//Let the owner of the file have hello.sh Execute permission
./hello.sh
Declare a temporary variable in the current window:
Hi=sniper.hi
Echo $hi
Pstree
Gnome-terminal─┬─bash───pstree
│├─bash
│├─gnome-pty-helpe
│└─2*[{gnome-terminal}]
Bash//Start a new shell subprocess, Bash command, start for subprocess, note the path difference
Pstree
Gnome-terminal─┬─bash───bash───pstree
│├─bash
│├─gnome-pty-helpe
│└─2*[{gnome-terminal}]
Go back to the previous level process exit
Problems encountered:
HELLO.SH//Such direct execution does not
hi = Sniper.hi//assignment in the shell, no spaces need to be written Hi=sniper.hi
The Helloword of the shell