The UNIX and Linux Forums  

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 -->
  #6 (permalink)  
Old 11-20-2008
lahiru lahiru is offline
Registered User
  
 

Join Date: Nov 2008
Posts: 4
Check with this

Quote:
Originally Posted by senthil_is View Post
I have file with 70 lines.

I want to add 'SLV' at the starting of the line if the line has first character as 0 or 1 or 2 or ..9

Nothing else has to be changed in the file. Please anyone advice.
=======================================================

#!/usr/bin/ksh

ls -l |grep .txt|nawk '{print $9}' > list

while read FILE

do

perl -pi -e 's/01/09\/SWV/g' $FILE

done <list