tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: '/bin/sh -c' with multiple args



On Fri, Dec 05, 2025 at 07:44:31AM +0700, Robert Elz wrote:
>     Date:        Thu, 4 Dec 2025 22:01:56 -0000 (UTC)
>     From:        mlelstv%serpens.de@localhost (Michael van Elst)
>     Message-ID:  <10gt0ck$9jl$1%serpens.de@localhost>
> 
>   | The option '-c' takes a single argument (command_string),
> 
> That's not even close to correct, -c takes no argument at all.
> 
> The only shell option with an arg is -o, all the rest are simply
> flags.

That's a bit playing with words. Even the source speaks about
"argument to -c option".


>   | The SYNOPSIS on the man page seems to wrong, or at least,
>   | misleading.
> 
> It isn't, but you do need to actually read the text to interpret it.

I am sure it is misleading, and it would be less so if you write it like:

sh -c [-s] [-abCEeFfhIiLlmnpquVvXx] [+abCEeFfhIiLlmnpquVvXx]
  [-o option_name] [+o option_name]
  "shell script" [arg0 [arg1 ... argN]]




Home | Main Index | Thread Index | Old Index