This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 433914 - ", and must be a single argument" should be deleted.
", and must be a single argument" should be deleted.
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: tcsh (Show other bugs)
5.1
i686 Linux
low Severity low
: rc
: ---
Assigned To: Vojtech Vitek
Bill Huang
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-02-21 22:26 EST by Cai Xianchao
Modified: 2015-03-04 18:56 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-01-17 12:03:20 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
This is a patch fixing the bug. (589 bytes, patch)
2008-02-21 22:26 EST, Cai Xianchao
no flags Details | Diff

  None (edit)
Description Cai Xianchao 2008-02-21 22:26:56 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):
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:
Comment 1 Cai Xianchao 2008-02-21 22:26:56 EST
Created attachment 295585 [details]
This is a patch fixing the bug.
Comment 2 Vitezslav Crhonek 2008-03-04 06:21:27 EST
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.
Comment 3 Cai Xianchao 2008-03-04 19:50:30 EST
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.
Comment 4 RHEL Product and Program Management 2011-01-11 14:58:09 EST
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.
Comment 5 RHEL Product and Program Management 2011-01-12 10:14:10 EST
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.
Comment 6 Vojtech Vitek 2011-01-17 12:03:20 EST
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.

Note You need to log in before you can comment on or make changes to this bug.