On 3/24/21 3:49 PM, Ilkka Virta wrote: > On Wed, Mar 24, 2021 at 9:38 PM L A Walsh <b...@tlinx.org> wrote: > >> Hmmm...Now that I try to show an example, I'm not getting >> the same results. Grrr. Darn Heizenbugs. >> > > Just remember that if you test with printf, it always prints at least once, > which makes it look exactly as if it got an empty string argument, even if > there are none: > > $ set -- > $ printf ":%s:\n" "$@" > :: > $ set -- ; printf ":%s:\n" x "$@" > :x:
Testing with set -x is preferred. $ set -x --; printf ":%s:\n" "$@" + printf ':%s:\n' :: $ set -x --; printf ":%s:\n" x "$@" + set -x -- + printf ':%s:\n' x :x: -- Eli Schwartz Arch Linux Bug Wrangler and Trusted User
OpenPGP_signature
Description: OpenPGP digital signature