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 > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 09-01-2008
edrichard edrichard is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 8
Perl Script Syntax to Extract Everything After Special Character

Hi,

I am writing a Perl script that reads in many lines, if a line meets the criteria I want to edit, it. For example, the script will return the following example line... test=abc123

All I want to do is strip off the "test=" and just be left with the abc123. In my script I can easily return everything before the "=" but for the life of me I can't get everything after the "=". A snipit of the code is...

$line3=<FILE>;
$line3=~ s/^\s+//; #strips off space
$line3=~s/=.*//; #returns everthing before "="

Any help would be greatly appreciated, thanks.

print "$line3\n";