I'm writing a script to configure Debian installs..... I need to comment out the line in sources.list for the DVD, I'm trying to use sed, I know how to delete the line or lines but I want to comment it out instead.
What I have is this:
sed -i '/deb cdrom:[Debian GNU/Linux 9.4.0 _S/s/^/#/' /etc/apt/sources.list
but it gives this error:
sed: -e expression #1, char 44: unterminated address regex
I'm guessing that it's the bracket that is the trouble.
What is the trouble here and how do you fix the command and/or is there some other way of doing this?