The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




Thread: single quote
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 12-01-2007
fpmurphy's Avatar
fpmurphy fpmurphy is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2003
Location: Florida
Posts: 1,937
Try the following awk script:


Code:
$1 != "comment"  { print }
$1 == "comment" {
                 changed = substr($6, 0, length($6) - 1)
                 printf("%s %s %s %s %s '%s';\n", $1, $2, $3, $4, $5, changed )
                        }

awk -f awkscriptfile scriptfile > newscriptfile