In Bash, printf appears to preserve field width when run directly, but the spaces seem to disappear after capturing its output with command substitution: $ printf "%-9s:" "since"…
I'm trying to capture a multi-line here-document in a Bash variable using command substitution. The backtick version works, but this version behaves unexpectedly: MYDOC=$(cat <<LIST Testing a multi-line…
I have a shell script that creates a temporary file, opens it in a new terminal with Vim, and then prints the edited contents before deleting the file.…
I've been battling a command substitution issue in my bash script that's driving me nuts! I have a binary that I need to execute, but it sometimes fails,…