Disclaimer: Yes, finding files in a script with ls is bad, but find can't sort by modification date.
Using ls and xargs with echo everything is fine:
$ ls -t1 ssl-access*.gz | xargs -n 1 echo
ssl-access.log.2.gz
ssl-access.log.3.gz
ssl-access.log.4.gz
[...]
Changing echo to zcat:
$ ls -t1 ssl-access*.gz | xargs -n 1 zcat
gzip: ssl-access.log.2.gz.gz: No such file or directory
gzip: ssl-access.log.3.gz.gz: No such file or directory
gzip: ssl-access.log.4.gz.gz: No such file or directory
[...]
Duplicate file suffixes?! What is going on here?
UPDATE:
OS is Debian 5.
zcat is a shell script at /bin/zcat:
#!/bin/sh
PATH=${GZIP_BINDIR-'/bin'}:$PATH
exec gzip -cd "$@"
zcatexecutable (probably a shell script) and see if it is auto-appending a.gzextension. – jw013 Oct 21 '11 at 20:51-printf %t(gnu-only) or-exec stat -c '%X' {}\;then pipe it tosort. – Shawn J. Goff Oct 21 '11 at 21:10zcata file that is not compressed? – Shawn J. Goff Oct 21 '11 at 23:14gzip: test.txt: not in gzip formatwith return code 1. – Legate Oct 21 '11 at 23:19xargsis running the command for a batch of files at once, and you're not using this capability, so don't even consider using it. About the strange behavior you observe: what doestype zcatshow? What is the full output fromls -t1 ssl-access*.gz? – Gilles Oct 22 '11 at 2:11