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): tcsh-6.15.00 How reproducible: Steps to Reproduce: 1.[test@localhost ~]$ ls test 2.[test@localhost ~]$ pwd /home/test 3.[test@localhost ~]$ if (1) ls;pwd test /home/test Actual results: The command 'ls' and 'pwd' both are executed correctly. Expected results: There is a error outputed or only one command is executed. Additional info:
Created attachment 296861 [details] This is a patch fixing the bug.
Try: [test@localhost ~]$ if (0) ls;pwd /home/test The second command does have nothing to do with the 'if' statement.
I see. 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 simple command'. Thanks for your example.