I do:
set output
echo ">$1<"
>output<
output=""printf ${1:+-v $1} "%s:%s" 23 myproc
-Bash: printf: ` output': not a valid identifier
for some reason it is regarding the space before $1 in
the printf as part of the variable name.
It doesn't seem to do this on linux (lnx 4.4.12(3), cyg-4.4.12(1)).
If I remove the space it works on both linux and cygwin.
The manpage shows [-v var], as the syntax, but [-vVAR] works in both
places. Is the manpage only correct sometimes? Or is there some switch to
toggle this behavior that I don't know about?
Thanks!
-linda