helpThe GNU Bourne-Again SHell - Support: sr #107863, Error in man page describing -c...


sr #107863: Error in man page describing -c option as taking an argument.

Submitted by:  Kaz Kylheku <kkylheku>
Submitted on:  Thu 03 Nov 2011 04:03:59 PM UTC  
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  Done
Privacy:  Public Assigned to:  None
Open/Closed:  Open Operating System:  None

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Tue 22 Nov 2011 12:35:06 AM UTC, comment #1: 

Not quite.  I agree that the description of the option is slightly wrong, though the bash man page mirrors the traditional Unix shell manual page description (through SVR4.2, at least).

However, the argument is not interpreted as a script.  It's a string, parsed and executed as one or more commands, similarly to `eval'.

Thanks for the report.  I'll update the man page and texinfo documentation.

Chet Ramey <chet>
Project Administrator
Thu 03 Nov 2011 04:03:59 PM UTC, original submission:  

This was reported by Geoff Clare in the newsgroup on November 3, 2011.

The bash man page says:

       -c string If the -c option is present,  then  commands  are  read  from
                 string.   If  there  are arguments after the string, they are
                 assigned to the positional parameters, starting with $0.

This is not actually how the option works.

It's an option with no argument, which causes the first non-option argument to be interpreted as a script, which can be seen if we add more options. (Consistent with POSIX.)

$ bash -c -x asdf
+ asdf
bash: asdf: command not found

Kaz Kylheku <kkylheku>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by chet (Posted a comment)
  • -email is unavailable- added by kkylheku (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-11-12 chet StatusNone => Done

    Back to the top

    Powered by Savane 3.5