how to use sed command
I wanted to replace regex
Code:
-o '-p -- \\u' Code:
--autologin wizard Code:
sed "s:-o /'-p -- \\u'/:--autologin wizard:" FILE |
Quoting is the problem, particularly handling of \\ inside double quotes. Try
Code:
echo "s:-o /'-p -- \\u'/:--autologin wizard:" Code:
echo "s:-o /'-p -- \\\u'/:--autologin wizard:" |
I've tried the solution you have provided but it is not working.
Code:
sed "s:-o /'-p -- \\\u'/:--autologin wizard:" |
Remove the forward slashes
Code:
sed "s:-o '-p -- \\\u':--autologin wizard:" |
If you remember the rules
In the shell within a 'string in ticks'
Code:
sed 's#-o '\''-p -- \\\\u'\''#--autologin wizard#' Code:
s#-o '-p -- \\\\u'#--autologin wizard# Code:
-o '-p -- \\u' Code:
--autologin wizard |
try this:
Quote:
|
All times are GMT -5. The time now is 07:37 PM. |