zl程序教程

您现在的位置是:首页 >  其它

当前栏目

Bash: options

Bash Options
2023-09-11 14:16:15 时间

 

bash [options] [command_string | file]

  1. -c If then -c option is present, then commands are read from the first non-option argument command_string. If there are arguments after the command_string, the first argument is assigned to $0 and any remaining are assigned to the positional parameters. The assignment to $0 sets the name of the shell, which is used in warning and error messages
    command_string 后面的都作为positional arguments

     

  2. -s If the -s option is present, of if no arguments remain after option processing, then commands are read from the standard input. This option allows the positional parameters to be set when invoking an interactive shell or when reading input through pipe

     

     

     

  3. -r  --restricted If the -r option is present, the shell becomes restricted
    How to Use Restricted Shell to Limit What a Linux User Can Do (howtogeek.com)