sed help - remove a period from a domain name


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting sed help - remove a period from a domain name
# 1  
Old 09-17-2009
sed help - remove a period from a domain name

I have this code that parses the output of a reverse dns lookup to a domain name

Code:
nslookup $IP | sed -n 's/.*arpa.*name = \(.*\)/\1/p'

But my ouput is always

randomsite.com.

Notice the period tacked on to the end. How do I correct this so it is just

randomsite.com



Thank you.
# 2  
Old 09-17-2009
Code:
nslookup $IP | sed -n 's/.*arpa.*name = \(.*\).$/\1/p'

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Remove text with sed or anything?

Hi there, my first post, so you might find my noobness ;) I need help to fix a thing, find /mnt/fs01/gfx/ -iname "*.rar" > gfx.txt Gives this contained textfile: /mnt/fs01/gfx/toba/toba.rar /mnt/fs01/gfx/zeta/zimba.rar /mnt/fs01/gfx/brashe/getha.rar And now the tricky part (for... (3 Replies)
Discussion started by: yabbah
3 Replies

2. Shell Programming and Scripting

sed remove everything between two string

Hi all, I have this input: "203324780",,"89321213261247090146","VfdsD150","0D","fd3221","V0343","aaa","Direkt","fsa","2015.02.27","39833,54454,21214",,,"fd","NORMAL","D","10fd","1243 Flotta","HiĂĄnytalan","2013.02.25",,"2013.02.25","2013.02.24","2013.02.28",,"SajĂĄt... (4 Replies)
Discussion started by: snayper
4 Replies

3. Shell Programming and Scripting

sed to remove

Hello I have a file with records...The records have several lines and have start and end born... This is a template: 000000001 LDR L ^^^^^nam^^2200325Iia^45e0 000000001 022 L $$a0081-3397 000000001 041 L $$aSPA 000000001 088 L $$aJ.E.N. 551 000000001 090 L $$aINFORMES JEN... (22 Replies)
Discussion started by: ldiaz2106
22 Replies

4. Shell Programming and Scripting

Removing domain suffix with SED

Hi Experts, I have a syslog file from 1000's of different hosts which I want to adjust by removing the domain suffix from the hosts. My previous attempts haven't managed to match all the different lenghts of the subdomains which are being logged. Could somebody suggest which sed syntax... (6 Replies)
Discussion started by: krypton
6 Replies

5. Windows & DOS: Issues & Discussions

How to: Linux BOX in Windows Domain (w/out joining the domain)

Dear Expert, i have linux box that is running in the windows domain, BUT did not being a member of the domain. as I am not the System Administrator so I have no control on the server in the network, such as modify dns entry , add the linux box in AD and domain record and so on that relevant. ... (2 Replies)
Discussion started by: regmaster
2 Replies

6. Shell Programming and Scripting

Sendmail: Remove domain name from From mail id

While sending mails using sendmail, the domain name is getting appended to the from id. My requirement is not to have that domain name in the From mail id. Could anyone help me on this? I am using the below command: cat t|/usr/lib/sendmail -f"Admin" user1@domain1.com (0 Replies)
Discussion started by: skar_a
0 Replies

7. Shell Programming and Scripting

sed over writes my original file (using sed to remove leading spaces)

Hello and thx for reading this I'm using sed to remove only the leading spaces in a file bash-280R# cat foofile some text some text some text some text some text bash-280R# bash-280R# sed 's/^ *//' foofile > foofile.use bash-280R# cat foofile.use some text some text some text... (6 Replies)
Discussion started by: laser
6 Replies

8. UNIX for Dummies Questions & Answers

remove lines in text starting with . (period)

how can i remove lines from a text file starting with . (a period) (11 Replies)
Discussion started by: Movomito
11 Replies

9. Shell Programming and Scripting

sed remove

anyone out there knows how to remove pattern <random string> use sed? (6 Replies)
Discussion started by: jamwong
6 Replies
Login or Register to Ask a Question