I want to append this line:
define(\RELAY_MAILER_ARGS', \TCP $h 587')dnl
In the 4th line of a file using bash, I need to do to put in script.
Using sed
:
sed "4i define(\RELAY_MAILER_ARGS', \TCP $h 587')dnl" {filename}
to repalce the content of fole:
sed -i "4i define(\RELAY_MAILER_ARGS', \TCP $h 587')dnl" {filename}
i
command insert above the addressed line? I would think you'd need a
for "appending under a specific line number"
Jan 16, 2020 at 12:49
$h
meant to be interpreted literally, or as the contents of a shell variable?