WebFinally your shortest solution will probably be @Luc-Olivier's answer, involving substitution, in the following form (don't forget to escape forward slashes too when part of the …
bash - How can I search for a string with a literal backslash when ...
WebJan 16, 2024 · If you use the -F flag to grep, to search for a fixed string, you can pass just \G and get the same result. (That is, if you pass \G so that grep sees \G, which will require that you escape the backslash in some way so the shell doesn't remove it.) Share Improve this answer answered Jan 16, 2024 at 2:56 Wildcard 34.8k 24 129 252 WebJul 18, 2024 · If one wants to stick with slash as a separator and use double quotes then all escaped backslashes have to be escaped one more time to preserve their literal … courtney ondeck md
Escape forward slashes in bash script argument for sed replacement
WebYou can use forward slash just fine to simplify things, so the command "cygpath -m" can do that. I found a variable in my cygwin environment that has the proper directory name -- USERPROFILE. It has "C:\Users\myname_001" value. I set a new variable to hold this in .bashrc: WINHOME=$ (cygpath -m "$USERPROFILE") $ echo $WINHOME … WebJun 9, 2015 · You cannot create a file the name of which includes a forward slash (/), until your file system has bug. There is no way to escape a forward slash. So if you can create a file such as ‘/12.txt’ or ‘b/c.txt’ then … WebMay 18, 2024 · If you are using double quotes (As you are), the backslash will escape the other backslash while the quotes are evaluated, then the resulting backslash will be … brianna\\u0027s phone number