Running shell command that has nested quotes via ssh

A quoted heredoc allows you to omit the outer quotes:

ssh user@host <<'END'
df | grep /dev/ | awk 'BEGIN{print "DISK", "%USAGE", "STATUS"} {split($5, a, "%"); var="GREEN"; print $1, $5, var}' | column -t
END

Leave a Comment