Overview shell and shell script execution mode

SUMMARY shell
  shell is a command line interpreter, which provides a transmission request to the kernel to run the program for the user interface system level program, the user can start with a shell, suspend, stop or even some programs are written.
  shell is still a quite powerful programming language, easy to write, easy to debug, flexibility is strong. shell scripting language is interpreted, in the shell can call the Linux system commands directly


Classification of the shell
  Bourne Shell: From 1979 onwards began using Unix Bourne Shell, Bourne Shell master file called SH
  C Shell: Shell C is mainly used in the BSD version of Unix systems, and its syntax is similar to c language named
  Shel there are two main types of grammar Bourne and C, both of grammar is not compatible with each other. Bourne family including sh, ksh, Bash, psh, zsh; C family including: csh, tcsh
  Bash: sh compatible with Bash, Linux is now used as a basic Bash Shell using the user's


Supported Linux shell
  / etc / shells

 

shell script execution mode
  echo command output
  echo [options] [output] content
  -e: Support backslash character conversion control


  -e echo "ab & \ BC"
  # delete the character to the left
  echo -e "A \ TB \ TC \ Nd \ TE \ TF"
  # newline and tab
  echo -e "\ e [1; 31m abcd \ e [ 0m "
  # output color
  # 30m = black, 31m = red, 32m = green, 33m = yellow
  # 34m = blue, 35m = magenta, 36m = cyan, 37m = white

 

  The first script
  vi hello.sh
  #! / Bin / Bash
  echo -e "hanzhiyu ahhahahah"

  Script execution
  given execute permissions, directly run
  chmod 755 hello.sh
  ./hello.sh
  execute the script by calling Bash
  Bash hello.sh

Guess you like

Origin www.cnblogs.com/hanzhiyu/p/11426262.html