home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / unix / riscbsd / datafile / usd / 03_shell / t4_txt < prev   
Encoding:
Text File  |  1996-10-12  |  2.8 KB  |  397 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.                              -2-
  71.  
  72.  
  73. Appendix A - Grammar
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.                              -3-
  137.  
  138.  
  139.      item:          word
  140.                input-output
  141.                name = value
  142.  
  143.      simple-command: item
  144.                simple-command item
  145.  
  146.      command:  simple-command
  147.                ( command-list )
  148.                { command-list }
  149.                for name do command-list done
  150.                for name in word  do command-list done
  151.                while command-list do command-list done
  152.                until command-list do command-list done
  153.                case word in case-part  esac
  154.                if command-list then command-list else-part fi
  155.  
  156.      pipeline:      command
  157.                pipeline  command
  158.  
  159.      andor:         pipeline
  160.                andor && pipeline
  161.                andor  pipeline
  162.  
  163.      command-list:  andor
  164.                command-list ;
  165.                command-list &
  166.                command-list ; andor
  167.                command-list & andor
  168.  
  169.      input-output:  > file
  170.                < file
  171.                 word
  172.                 word
  173.  
  174.      file:          word
  175.                & digit
  176.                & -
  177.  
  178.      case-part:     pattern ) command-list ;;
  179.  
  180.      pattern:       word
  181.                pattern  word
  182.  
  183.      else-part:     elif command-list then command-list else-part
  184.                else command-list
  185.                empty
  186.  
  187.      empty:
  188.  
  189.      word:          a sequence of non-blank characters
  190.  
  191.      name:          a sequence of letters, digits or underscores starting with a letter
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.                              -4-
  203.  
  204.  
  205.      digit:         0 1 2 3 4 5 6 7 8 9
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.                              -5-
  269.  
  270.  
  271. Appendix B - Meta-characters and Reserved Words
  272.  
  273. a) syntactic
  274.  
  275.            pipe symbol
  276.  
  277.      &&    `andf' symbol
  278.  
  279.            `orf' symbol
  280.  
  281.      ;     command separator
  282.  
  283.      ;;    case delimiter
  284.  
  285.      &     background commands
  286.  
  287.      ( )   command grouping
  288.  
  289.      <     input redirection
  290.  
  291.            input from a here document
  292.  
  293.      >     output creation
  294.  
  295.            output append
  296.  
  297.  
  298.  
  299. b) patterns
  300.  
  301.            match any character(s) including none
  302.  
  303.      ?     match any single character
  304.  
  305.      [...] match any of the enclosed characters
  306.  
  307.  
  308.  
  309. c) substitution
  310.  
  311.      ${...}
  312.            substitute shell variable
  313.  
  314.      `...` substitute command output
  315.  
  316.  
  317.  
  318. d) quoting
  319.  
  320.      \     quote the next character
  321.  
  322.      '...' quote the enclosed characters except for '
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.                              -6-
  335.  
  336.  
  337.      "..." quote the enclosed characters except for $ ` \ "
  338.  
  339.  
  340.  
  341. e) reserved words
  342.  
  343.      if then else elif fi
  344.      case in esac
  345.      for while until do done
  346.      {  }
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.