user3310334
user3310334

Reputation:

Comments in sed command file

Can I put comments (or something functionally equivalent) into a sed command file?

subs.sed

s/this/that/g
# comment
s/it/they/g
$ sed -i -f subs.sed <(echo this it)
that they

Upvotes: 1

Views: 818

Answers (1)

0stone0
0stone0

Reputation: 43884

Yes, comments can be added to a sed file using #.


From the manual page of sed:

Command Synopsis

...

#comment

The comment extends until the next newline (or the end of a -e script fragment).

Upvotes: 2

Related Questions