Vincent Lefevre (HE12026-11-16):
> > - printf "\a": The printf command works similarly to echo -e "\a".
> AFAIK, this one is portable.
The escaping if fragile, it relies on the fact that a is not a special
character for escaping and therefore the backslash in front of it will
not have its special semantic.
For a more robust escaping, prefer:
printf "\\a" → the backslash is properly escaped.
printf '\a' → no escaping needed in single quotes.
printf $'\a' → less portable, the shell does the \a→BEL translation, not
the printf command.
printf → type it with ctrl-V for example, no escaping needed.
Regards,
--
Nicolas George