Metropolis: Implementation of Interlock Protocol using LinuxShell Programming, OpenSSH, and GPG
Scott Neugroschl
scott_n at xypro.com
Tue Oct 5 09:51:03 EST 2010
Quoth Ángel González
> Don't use things like ls | grep ^received00
> That will fail if there's a file listed before (eg. "foo received00"),
> ls -l | grep received00 may work (with false positives) but
> it's much easier to do it right: test -f received00
>
ls checks to see if its stdout is a tty. If not, then it outputs
one file per line. So there is no problem with Arief's original.
However, "test -f" is still better, as it's lower overhead and
more clear as to the intent.
More information about the openssh-unix-dev
mailing list