The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
delete \n character ReneVielma Shell Programming and Scripting 2 05-29-2008 03:46 PM
Need to serach if a new line character exists on the last line in a file sunilbm78 UNIX for Dummies Questions & Answers 10 02-29-2008 10:15 AM
delete a line based on first character of the line borncrazy UNIX for Dummies Questions & Answers 2 12-06-2005 11:27 AM
Use sed to delete a character bthomas Shell Programming and Scripting 1 05-19-2005 12:21 PM
How to delete a character davidg UNIX for Advanced & Expert Users 3 02-18-2004 11:16 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-20-2005
Registered User
 

Join Date: Mar 2004
Posts: 39
Question How to delete last character of a line?

Hello,
I think I'm close to doing this, but I could be wrong.
I have a string I would like to search for and delete the last character of the that line.
This is what I have...
sed 's/POHEAD\(.\)$//g' tempd > tempe

The above works if I search for P, but that won't work. I need to search for POHEAD.

thnx,
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 06-20-2005
reborg's Avatar
Administrator
 
Join Date: Mar 2005
Location: Ireland
Posts: 3,513
Code:
sed '/POHEAD/ s/.$//' tempd > tempe
Reply With Quote
  #3 (permalink)  
Old 06-20-2005
Registered User
 

Join Date: Mar 2004
Posts: 39
Thank you very much
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 06:33 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0