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): tcsh-6.15.00 How reproducible: Steps to Reproduce: 1.[test@RHEL5 ~]$ tcsh -c pwd ls /home/test 2.[test@RHEL5 ~]$ echo $? 0 Actual results: It only executed the first command and the return value is 0. Expected results: The return is not 0. Additional info:
Created attachment 295585 [details] This is a patch fixing the bug.
Hi, 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[1]. 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[1] 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 must be". 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.
Hi, the man page is correct in my opinion as well. Consider following two examples: 1) $ tcsh -c 'echo 1; echo 2;' echo 3 1 2 ..as you can see, "echo 3" was not executed as part of the command, it was just stored as _shell_ argv variable (see below). 2) $ tcsh -c 'echo $1; echo $2' echo 3 echo 3 ..now we have printed first and second _shell_ argv variables (as seen in interactive shell). Closing as NOTABUG.