Hmm... I've never written scripts that do a huge amount of mixed string and variable output, so I never thought about the issues you describe. The way things work now, you'd either have to write:
echo "Couldn't open file: "$file
echo "Looking for /home/"$USER/$filename
which are _exactly_ the same length as the bash equivalent, but might feel unintuitive, or you could write:
printf "Couldn't open file: %s\n" $file
printf "Looking for /home/%s/%s\n" $USER $filename
which in my opinion look nice and clear, but they are slightly longer. It seems to me that for any complex formating, the power and clarity of printf far outweighs the brevity of echo and variables in quoted strings. But I might be wrong. You are more than welcome to try and persuade me that I am wrong.
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds