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 and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Search, replace string in file1 with string from (lookup table) file2? gstuart Shell Programming and Scripting 9 06-08-2009 07:11 AM
replace string in XML with sed chiru_h Shell Programming and Scripting 6 04-09-2008 08:49 PM
SED Replace String Help prash184u Shell Programming and Scripting 2 01-23-2008 01:57 AM
replace a string melanie_pfefer Shell Programming and Scripting 11 01-17-2008 10:57 AM
Replace string B depending on occurence of string A hemangjani Shell Programming and Scripting 1 12-05-2006 05:10 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-04-2008
sam99 sam99 is offline
Registered User
  
 

Join Date: Aug 2007
Posts: 39
replace string

Hi,

how to replace a string 44247288- with (44247288).

if the string is 44247288 then no change is required.

thanks,
sam
  #2 (permalink)  
Old 03-04-2008
pooga17 pooga17 is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 9
sed s/"44247288-"/"44247288"/g <file_name>
  #3 (permalink)  
Old 03-04-2008
sam99 sam99 is offline
Registered User
  
 

Join Date: Aug 2007
Posts: 39
44247288 is not fixed it will change each time.

regards,
sumith

Quote:
Originally Posted by pooga17 View Post
sed s/"44247288-"/"44247288"/g <file_name>
  #4 (permalink)  
Old 03-04-2008
danmero danmero is offline Forum Advisor  
  
 

Join Date: Nov 2007
Location: 45.48-73.63
Posts: 1,439
Quote:
Originally Posted by sam99 View Post
44247288 is not fixed it will change each time.

regards,
sumith
If you want to remove the ending minus

Code:
echo "44247288-" | sed 's/-//g'

  #5 (permalink)  
Old 03-04-2008
apsprabhu apsprabhu is offline
Registered User
  
 

Join Date: Feb 2008
Location: India
Posts: 45
hi,

kindly explain your scenario in brief.

Thanks.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:10 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0