Red Hat Bugzilla – Bug 436072
"command" can be a command list in builtin "if"
Last modified: 2008-03-05 19:56:35 EST
Description of problem:
The manpage says that "command must be a simple command, not an alias, a
pipeline, a command list or a parenthesized command list, but it may have
arguments.", but "command" can be a command list.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1.[test@localhost ~]$ ls
2.[test@localhost ~]$ pwd
3.[test@localhost ~]$ if (1) ls;pwd
The command 'ls' and 'pwd' both are executed correctly.
There is a error outputed or only one command is executed.
Created attachment 296861 [details]
This is a patch fixing the bug.
[test@localhost ~]$ if (0) ls;pwd
The second command does have nothing to do with the 'if' statement.
The tcsh regards 'if (0) ls;pwd' as two commands, 'if (0) ls' and 'pwd'.
Actually, when I saw something like 'command must be a simple command', I
thought it would fail and the exit code would be not 0 if 'command is not a
Thanks for your example.