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 -->
  #2 (permalink)  
Old 03-19-2009
dariyoosh's Avatar
dariyoosh dariyoosh is offline
Registered User
  
 

Join Date: Mar 2009
Location: Iran (Tehran)
Posts: 44
Hello there,

I think that the following KornShell script does the job

Code:
#!/bin/ksh

RESULT=""
TARGET_TOKEN="FBINV,"

while read LINE
do
    if [[ $LINE = TARGET_TOKEN* ]]
    then
        RESULT="$RESULT$LINE\n"
    else
        RESULT="$RESULT$TARGET_TOKEN$LINE\n"
    fi
done < $1

RESULT="$RESULT\n"
print "$RESULT" > $1
Regards,