Results 1 to 3 of 3
hehe. sorry, thought it was funny.
so i am trying to edit sshd_conf files to change the "#Port 22" to "Port 22" from a script.
I have tried this many ...
- 02-04-2011 #1
[SOLVED] sed dead redemption...
hehe. sorry, thought it was funny.
so i am trying to edit sshd_conf files to change the "#Port 22" to "Port 22" from a script.
I have tried this many different ways.
sshs1='s/#Port 22/Port 22/g'
sed $sshs1 /home/l/Desktop/test
the reason i have it as a string in this instance is because $sshs1 gets a variable, but im not working on that right yet.
I've tried changing the ' to ` and ".
this is what i get:
'
sed: -e expression #1, char 7: unterminated `s' command
`
sed: -e expression #1, char 8: extra characters after command
sed: -e expression #1, char 8: extra characters after command
"
sed: -e expression #1, char 7: unterminated `s' command
i know it may have to do with my regex, but i cant seem to find a decent tut. to point me in the right direction.
thanks in advance
- 02-04-2011 #2should probably read assshs1='s/#Port 22/Port 22/g'
sed $sshs1 /home/l/Desktop/test
you see: no regex problems at all. a bash guide may be more helpful in your case.sshs1='s/#Port 22/Port 22/g'
sed "$sshs1" /home/l/Desktop/test
- 02-04-2011 #3
haha!!
that was awesome, but you are probably right about that.
thank you for the enlightenment though.


