Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-24-2003, 09:39 AM   #1
LQ Newbie
Registered: Sep 2003
Location: Canada
Distribution: Fedora & Gentoo-uClinux
Posts: 15

Rep: Reputation: 0
sed help, replacing a letter with a word

Ok I have a file with names and departments they work in


Tom harding engineer 452 5567 engineering 66444 T
Greg Thio Acct 445-6677 supervisor 554454 T

I want to replace the T with Temp in the whole file

when I so this;

$ sed 's/T/Temp/g' <file name>

or sed 's/ T/Temp/g' I get

Tempom harding engineer 452 5567 engineering 66444 Temp

How do I just replace the T at the end of the line?

Old 09-24-2003, 10:21 AM   #2
LQ Newbie
Registered: Sep 2003
Location: Canada
Distribution: Fedora & Gentoo-uClinux
Posts: 15

Original Poster
Rep: Reputation: 0
I got it,

$ sed 's/\T$/Temp/g' <file>

thanks anyway guys


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
bash scripting capitalizing first letter or each word in a string hypexr Programming 6 06-16-2011 09:58 AM
a command/script for replacing a word with another jaakkop Programming 14 12-04-2005 10:21 AM
oh god, the three letter word, ATI onelung02 SUSE / openSUSE 8 10-12-2004 05:17 PM
/proc/version/four/letter/word opioid Linux - Security 2 02-27-2004 08:28 PM
replacing pattern with sed produces double realos Programming 1 10-17-2002 08:03 PM

All times are GMT -5. The time now is 04:13 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration