I have a long command line, longer than but similar to the example below. I would like to add comments to individual argument in the sense of what is shown here:
ssh -N \
-R :10000:10.0.0.1:80 \ # test system
-R :10001:10.0.0.2:80 \ # integration system
-R :10002:10.0.0.3:80 \ # database foo
-R :10003:10.0.0.4:80 \ # some other server
example.com
But this sadly does not work as the \
characters here no longer escape the newlines. Instead it escapes the space in front of the #
an thus prevents the #
from being parsed as the start of a comment (#
may not appear inside of a token if it should be parsed as the start of a comment).
This also doesn't work because here, instead of the \
escaping the #
, the #
now prevents the \
from being interpreted.
-R :10000:10.0.0.1:80 # test system \
Is there any way to somehow mix comments and command line arguments (maybe on individual lines) of a single, long command? If not, what would you suggest I do to somehow associate the data passed to the command with commends to describe it?