mainThe 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.

Submitter:  Kaz Kylheku <kkylheku>
Submitted:  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
* Mandatory Fields

Add a New Comment Rich Markup

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>
Group 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)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    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.12.
    Corresponding source code