The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
perl vs shell scripts JamesByars Shell Programming and Scripting 7 01-15-2008 11:38 AM
Problem with cat with PERL Substitute jingi1234 UNIX for Advanced & Expert Users 2 03-23-2007 12:11 AM
what's the debug command for perl scripts dayanandra Shell Programming and Scripting 2 05-19-2006 01:21 PM
Learning to write UNIX Shell Scripts VENC22 UNIX for Dummies Questions & Answers 1 04-29-2005 05:03 AM
Urgent!! How to write a shell program to execute command to access internet? firebirdonfire UNIX for Dummies Questions & Answers 2 04-26-2001 08:16 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-02-2007
Registered User
 

Join Date: Jun 2007
Posts: 10
Stumble this Post!
Lightbulb how to write perl substitute command in shell scripts

How to write perl substitute command in shell script without invoking a perl script file seperately.

for ex:

shell script to relace IT with CSC in a file using perl substitute command.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 07-02-2007
kamitsin's Avatar
Registered User
 

Join Date: Nov 2006
Location: /dev/null
Posts: 177
Stumble this Post!
Code:
#!/bin/ksh
/usr/bin/perl -i -pe 's/IT/CSC/g'
Just out of curiosity, why do you want to do this? You can do this easily with sed !!
Reply With Quote
  #3 (permalink)  
Old 07-02-2007
Shell_Life's Avatar
Unix/Informix/4GL/SQL
 

Join Date: Mar 2007
Location: Bahia, Brazil
Posts: 695
Stumble this Post!
Kamitsin,
It smells like homework.
Reply With Quote
  #4 (permalink)  
Old 07-03-2007
Registered User
 

Join Date: Jun 2007
Posts: 10
Stumble this Post!
i need to replace the string in unix file.
On opening the same file am getting line too long error. So using sed will not work.

Thanks for ur reply
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:04 AM.


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

Content Relevant URLs by vBSEO 3.2.0