Multiline bash using sed to remove leading whitespace: quotes erroneously preserved in command argument
问题 I am running this piece of code: annotate-output $((sed -E 's/^[ ]+//;' <<____COMMAND sshfs foo_user@fooserver.com:/sftp_folder /var/sshfs.sandbox/server.com -o user=foo_user ,reconnect ,ServerAliveInterval=15 ,ServerAliveCountMax=3 ____COMMAND ) | sed -E -e ':a;N;$!ba;s/\n//g') It's my (perhaps clumsy) attempt at having a generic way of achieving multiline in bash. Note that there is a trailing space whenever it is needed by the command I'm trying to split into multple lines: sshfs foo_user