Red Hat Bugzilla – Bug 433914
", and must be a single argument" should be deleted.
Last modified: 2015-03-04 18:56:38 EST
Description of problem:
There is a statement about option "-b" of tcsh:
"-c Commands are read from the following argument (which must be
present, and must be a single argument),".
But, "commands" may not be a single argument, manpage also says that "any
remaining arguments are placed in the argv shell variable."
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1.[test@RHEL5 ~]$ tcsh -c pwd ls
2.[test@RHEL5 ~]$ echo $?
It only executed the first command and the return value is 0.
The return is not 0.
Created attachment 295585 [details]
This is a patch fixing the bug.
thanks for report.
I think the man page is correct - e.g. assume those two commands:
tcsh -c 'cat file.txt'
tcsh -c cat file.txt
First command will concatenate file.txt, second will run cat and store
'file.txt' to argv. In my opinion this is the reason, why command "must be a
single argument" statement is present in the man page.
In your example, return value is related only to the result of command in -c
argument (pwd), and pwd command is successful - so it returns zero. 'ls' is
stored in argv and is not used at all.
There are two reasons that ", and must be a single argument" should be deleted
in my opioion.
First, I think there will be a error message output if manpage says "something
Second, the manpage also says "Any remaining arguments are placed in the argv
shell variable", so commands after argument '-c' can not be a single argument.
As a result ", and must be a single argument" is redundant.
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.
This request was erroneously denied for the current release of
Red Hat Enterprise Linux. The error has been fixed and this
request has been re-proposed for the current release.
the man page is correct in my opinion as well.
Consider following two examples:
$ tcsh -c 'echo 1; echo 2;' echo 3
..as you can see, "echo 3" was not executed as part of the command, it was just stored as _shell_ argv variable (see below).
$ tcsh -c 'echo $1; echo $2' echo 3
..now we have printed first and second _shell_ argv variables (as seen in interactive shell).
Closing as NOTABUG.