Re: system calls return code

2008-03-27 Thread ultra . star . x
Thank you very much for explaining. I will try what Sandy suggested. I had tested at the command line already just as Jeff did. The confusion came from the fact that I had tried it in csh and in csh, doing the "ls |xargs cat" returned 1. Annoying. C. -- To unsubscribe, e-mail: [EMAIL PROTEC

Re: system calls return code

2008-03-27 Thread Sandy
On 27 мар, 03:50, [EMAIL PROTECTED] (Ultra Star X) wrote: > I am really going crazy here. I have the following system call that I > would like to run from perl: > "ls *.txt | xargs cat > out" > if *.txt does not exist then I expect to get an exit code different > from 0. > > So to test I do: > >

Re: system calls return code

2008-03-27 Thread Jeff Pang
This is because you send ls's output to a pipe, and the command on the right of the pipe get executed successfully. Try this test on shell: -bash-3.00$ ls |xargs cat ls: : No such file or directory -bash-3.00$ echo $? 0 -bash-3.00$ ls ls: : No such file or directory -bash-3.00$ ec