Using a shell script, How insert a line in a file which starts with a hash?

195 views Asked by At

I'm trying to insert a line of text beginning with a hash in a text file using a shell script, using something like this:

ex run <<EOEX
:i
#!/bin/bash
#SBATCH
.
:x
EOEX

But I want it to actually insert those lines beginning with the hash, and not treat them as comments. Thanks!

0

There are 0 answers