The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
string substitution laxmi Shell Programming and Scripting 3 02-16-2008 06:11 AM
Sed - substitution for whole string Scarlos Shell Programming and Scripting 4 07-12-2005 07:56 AM
String Substitution Question goodrics Shell Programming and Scripting 3 07-24-2003 04:00 PM
Sed String Substitution pciatto UNIX for Dummies Questions & Answers 2 04-29-2002 10:10 AM
Update text files in place (string substitution) ?? kornshellmaven UNIX for Dummies Questions & Answers 1 07-16-2001 11:11 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 02-16-2008
laxmi laxmi is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 19
String Substitution

Hey ppl,

Could u tell me how to replace such a string

xyz[y]->x with XYZ(x), where x can be any variable accessible by pointer to structure, xyz

in an entire file?
  #2 (permalink)  
Old 02-16-2008
agn agn is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 172
Try this:

Code:
perl -ne 's/([a-z]*)\[.\]->(.)/\U${1}\E\[${2}\]/; print' filename
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 07:58 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