anton wrote:

Paul Wilkins wrote:

anton wrote:

The purpose of this is to cat the actual text of all the files in the directory that don't end in .dat into a new file.
So far I have:
ls | grep -v "\.dat$" | cat > newfile
but cat just gives me the list of files again. Any way to force cat to consider the lines as files? Or a better way of doing this?



I'm not in Linux right now, but what happens when you redirect the output straight to a file.


ls | grep -v "\.dat$" > newfile


Exactly the same as above. Cat just takes what it gets from stdin and pipes it to stdout, so we get exactly the same...


In which case it will have to involve some scripting along the lones of the for loop that Jim was suggesting.

--
Paul Wilkins



Reply via email to