Hi
i am doing a script that gets input from a pipe (ie. from find) and it should be running like this .
$ find . -type f | script
>>START TRUE OUTPUT HERE<<<
file1 processed
find: ./etc/news/teset: Permission denied
file2 processed
file3 processed
file4 processed
find: ./etc/news/file5: Permission denied
file5 processed
:
:
but I am getting an output like this
$ find . -type f | script
find: ./etc/news/teset: Permission denied
find: ./etc/news/2/4: Permission denied
find: ./etc/news/3: Permission denied
>>START TRUE OUTPUT HERE<<<
file1 processed
file2 processed
file3 processed
file4 processed
file5 processed
:
:
It seems that stderr comes out first... what will I do with this kind of scenario ... Inside my script I have a while loop that reads from the pipe input ... any help ?
thanks
i am doing a script that gets input from a pipe (ie. from find) and it should be running like this .
$ find . -type f | script
>>START TRUE OUTPUT HERE<<<
file1 processed
find: ./etc/news/teset: Permission denied
file2 processed
file3 processed
file4 processed
find: ./etc/news/file5: Permission denied
file5 processed
:
:
but I am getting an output like this
$ find . -type f | script
find: ./etc/news/teset: Permission denied
find: ./etc/news/2/4: Permission denied
find: ./etc/news/3: Permission denied
>>START TRUE OUTPUT HERE<<<
file1 processed
file2 processed
file3 processed
file4 processed
file5 processed
:
:
It seems that stderr comes out first... what will I do with this kind of scenario ... Inside my script I have a while loop that reads from the pipe input ... any help ?
thanks