The problem is I have some database dumps which are either compressed or in plain text. There is no difference in file extension etc. Using zcat
on uncompressed files produces an error instead of the output.
Is there maybe another cat
sort of tool that is smart enough to detect what type of input it gets?
zcat
on only the compressed dumps. – mikeserv May 25 '14 at 16:36grep
can be instructed what to do if it encounters a binary type file - and that might make a good filter for the cleanup. – mikeserv May 25 '14 at 16:45