首页 > 其他分享 >Bash: options

Bash: options

时间:2023-01-23 12:55:10浏览次数:61  
标签:shell string positional present arguments options Bash option

 

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)

标签:shell,string,positional,present,arguments,options,Bash,option
From: https://www.cnblogs.com/dissipate/p/17065116.html

相关文章