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
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:
>
>
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