Using grep to find all strings (with %) in files recursively

To find all occurrences of printf in all files recursively: grep -rnw ~/bin/ -e "printf" However, how to escape the search pattern printf ‘%0? I failed in the following trials to escape the percentage sign: grep -rnw ~/bin/ -e "printf ‘%0" grep -rnw ~/bin/ -e "printf \’\%0" grep -rnw ~/bin/ -e "printf \’%%0" Sample file:… Read More Using grep to find all strings (with %) in files recursively

How do I avoid functions to read escape characters?

I have a list string that depicts directory paths, e.g.: | ‘directory path’ | |:—————-:| |’c:\\windows\\g\\subfolder1’| |’c:\\windows\\g\\subfolder2’| |’etc’ | The string is perfectly valid and when I print them they come out naturally as: print(dir_list[0]) dir_list[0] c:\windows\g\subfolder Out[1]: ‘c:\\windows\\g\\subfolder1’ However, when I use the string in a function I get the following error: df[‘directory path’].str.contains(dir_list[0])… Read More How do I avoid functions to read escape characters?

How can I have an = sign in an XML?

I have a Powershell script which calls an XML, gets a URL, and tries to open Chrome to that URL. Downside, the URL contains the = character, and none of the character escape suggestions I’ve seen work. Here’s the XML: <Config> <Stuff> <Application Name="Place" CaptivePortal="https://website.com:1337/php/uid.php?thing=1&stuff=0&quot; RDP="192.168.1.1" Entitlement="Admin" /> </Stuff> </Config> And here’s the section of… Read More How can I have an = sign in an XML?

keep apostrophes when passing string value in Innerhtml

The text value holds string text with double quotes and apostrophes as you see in the example. when I print the result it changes to different characters. The text that is coming from API is : "mismatched input ‘STARTt’ expecting ‘START’ "; but when I print it, it goes : "mismatched" input="" ‘startt’="" expecting="" ‘start’=""… Read More keep apostrophes when passing string value in Innerhtml

How can I include these characters: { } [ ] " ' \ in sed 's/[^0-9A-Za-z ]*//g'?

How can I include these characters: { } [ ] " ‘ \ in sed ‘s/[^0-9A-Za-z ]*//g’ ? From my understanding sed ‘s/[^0-9A-Za-z ]*//g’ prints only numbers & letters and ignores everything else. Now I also want to print above symbols along with letters & numbers. So how can I do that? >Solution : You… Read More How can I include these characters: { } [ ] " ' \ in sed 's/[^0-9A-Za-z ]*//g'?