Colin Watson wrote: > Adam Heath wrote: > > Guido Guenther wrote: > > > Just of out curiosity, is this in any way different from the shorter: > > > if [ "$var" ]; then > > var="-f" > Have you tried that? No POSIX shell will have a problem. You are confusing standards with portability. They are not the same thing. See my other posting for a real world example of this particular construct which fails on a shell on a commercial system which claims to be a POSIX shell. It probably is compliant to an older version of the standard. But standards change over time and just by standing still you fall behind. This particular construct is not portable to that system regardless of the presence of standards. I am not saying that Debian dpkg scripts should worry about strange or non-standard systems, nor indeed any non-Debian systems at all. I am just talking about portable script style and advocating defensive programming in general. Bob
Attachment:
pgpSCiP4gRyVW.pgp
Description: PGP signature