sed command for using with back slashes


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers sed command for using with back slashes
# 1  
Old 07-25-2005
sed command for using with back slashes

hi all,


im trying to use a sed command to remove all occurenes of \p\g

what i used so far is : sed 's!\p\g!!g' file

but this doesnt work ?

Any ideas, thanks for helping.
# 2  
Old 07-25-2005
Not very good with sed, but you could try this:
Code:
sed 's/\\p\\g//g' file

# 3  
Old 07-25-2005
sweet, worked good for me.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed - use back reference in 2nd command

I have data that looks like this: <Country code="US"><tag>adsf</tag><tag>bdfs</tag></Country><Country code="CA"><tag>asdf</tag><tag>bsdf</tag></Country> I want to grab the country code save it, then drop each new "<..." onto a new line with the country code added to the beginning of each So,... (9 Replies)
Discussion started by: JenniferAmon
9 Replies

2. UNIX for Dummies Questions & Answers

Extract text in sed using back reference

i have a text 20 21 22 23 24 25 26 i want to get 22 using sed back reference. I have used sed 's/{6}\(..\).*/\1/' but, it does not work. I am missing something somewhere. Please help. (5 Replies)
Discussion started by: gotamp
5 Replies

3. Shell Programming and Scripting

sed back reference error

I am trying to change a single line of a special file whose comment character is ! to show a path to the file in the comment. such as: !!HFSS and mcm path: \Signal_Integrity\Package_SI\Section_Models\C4toTrace\28nm\D6HS\SLC_5-2-5\GZ41_ICZ\NSSS\ to a different path and replace the !!HFSS... (1 Reply)
Discussion started by: mobrien601
1 Replies

4. Shell Programming and Scripting

Bring back a file changed with sed

Hello everbody I changed one of my important files with a false sed statement by mistake now I lost my file and I hope I could bring it back what I did was: sed '/^..//' a > myfile myfile should have been another file like b ot something I know I also forgot to place an 's' to the... (5 Replies)
Discussion started by: miriammiriam
5 Replies

5. Shell Programming and Scripting

Using SED to copy/paste with slashes and tabs.

I have: 2012/01_January/Kite/foldername/otherfoldername/placeholderBlue I want to end up with: /foldername/otherfoldername/2012/01_January/Kite/Blue Basically take everything before the first tab and put it in the place of the consistently named word placeholder and add a slash in place... (2 Replies)
Discussion started by: crowman
2 Replies

6. Shell Programming and Scripting

How to use sed when a match has forward slashes

I'm trying to replace an alias with its match using sed but the match contains forward slashs so it causes the sed command to throw a garbled message.. cmd_list.txt sample AIX_myserver_1011_vintella.sudoers_cmndalias sample I'm trying to use the below but like I say it throws a... (5 Replies)
Discussion started by: Jazmania
5 Replies

7. Shell Programming and Scripting

Problem in Concatination of string in bash scripts containing back slashes.

My script is as follows: #!/bin/bash STR1="test" echo $STR1 STR2="/bldtmp/"$STR1 echo $STR2 STR3=$STR2'/tmp' echo $STR3 output i am geting ---------------- test /bldtmp/test /tmptmp/test but my need is: ------------------ test /bldtmp/test (1 Reply)
Discussion started by: dchoudhury
1 Replies

8. Shell Programming and Scripting

sed - how to remove trailing slashes

I know you can remove trialing slashes using: #echo "/tmp/one/two/three////" | sed "s,/$,," /tmp/one/two/three/// But I want to know how to make it remove all trialing flashes in the front, and in the start, so the end result is: tmp/one/two/three Anyone have any idea how to do this... (6 Replies)
Discussion started by: EXT3FSCK
6 Replies

9. Shell Programming and Scripting

Back Referencing in SED

Hi, I have tried all examples of back referencing from the web but all in vain. It would be heavily helpful if someone explains me the use of back referencing and sub expression using an example of substitution. Thanks (1 Reply)
Discussion started by: sinpeak
1 Replies

10. UNIX for Dummies Questions & Answers

Back Command

I'm pretty new to UNIX and was wondering what is the Unix command for going back one directory? (3 Replies)
Discussion started by: Jatic
3 Replies
Login or Register to Ask a Question