Quote:
Originally posted by oombera
Wow - I tried
(ls * | xargs cat) > all
It works the same and it's cool that it's so small.. but I keep getting the error:
cat: input/output files 'all' identical
The large file is created like it should be, but is there something additional to get rid of / suppress this error?
|
Ouch! First, that line has the same problem that your original solution did, we are asking the shell to replace * with a list of all files in the current directory. And that won't fly with 5,300 files. What I meant to type is:
(ls | xargs cat) > all
I also didn't think about the output file popping into existence before the ls ran. The best solution for that is something like:
(ls | xargs cat) > /some/dir/all
cat is smart enough to catch this, but grep isn't. And I'm still thinking that the op wanted to use grep to extract certain lines.