The shell is a program written in C language.
Several common Shell:bash, SH, csh, ksh, etc.
Bash is the default standard shell for Linux and is fully compatible with SH
SH is the default standard shell for UNIX
Ash is the smallest resource-intensive shell in Linux and contains only 24 commands
CSH is a larger kernel of Linux, with a total of 52 commands. The shell is actually a shell that points to/bin/tcsh, which means that csh is actually tcsh
Ksh a total of 42 internal commands. The biggest advantage of the shell is that it is almost completely compatible with the ksh of commercial distributions, so you can try out commercial version performance without having to pay for a commercial version.
First shell script
First, you need a linux/unix environment, if there is no environment, you can also install Cygwin on Windows, after the successful installation can open Cygwin64 Terminal, you can start to write shell script. Type VI firstshell.sh, enter the following text to save the exit (: Wq)
1 #!/bin/bash2echo"Hello world! "
, execute sh./firstshell.sh, Output Hello world!
or enter echo "Hello world!" directly in the terminal, and you can also get Hello world! The result.
#!/bin/bash's explanation:
"#!" is a contract tag that tells the system what interpreter the script needs to execute, that is, which shell to use. the echo command is used to output text to a window .
Shell Getting Started first lesson