LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 09-24-2003, 09:39 AM   #1
GridX
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

eg

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?



GridX
 
Old 09-24-2003, 10:21 AM   #2
GridX
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
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:16 AM.

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