Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Suppress Error message while using cat command

I have a script where I recursively copy the contents of the files in a folder using cat command as follows

test -f /tmp/$F || cat $F > /tmp/$F

I get the following error

cat: read error: Invalid argument

I want to know how can I suppress this error. I only have access to shell interpreter (no bash).

Thanks

like image 816
user27396 Avatar asked Nov 27 '14 21:11

user27396


1 Answers

Send error messages to /dev/null.

cat $F 1>/tmp/$F 2>/dev/null
like image 95
Bart Louwers Avatar answered Nov 01 '22 01:11

Bart Louwers