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



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to print single quote in awk gauravgoel UNIX for Dummies Questions & Answers 6 08-20-2008 04:48 PM
escaping single quote javeed7 Shell Programming and Scripting 3 04-02-2008 05:36 AM
single or double quote in SED asami Shell Programming and Scripting 2 07-17-2006 03:03 AM
AWK handling of single quote braindrain Shell Programming and Scripting 3 04-27-2006 04:57 PM
Replacing a single quote rjsha1 Shell Programming and Scripting 3 12-23-2005 10:55 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 12-01-2007
dreams5617 dreams5617 is offline
Registered User
  
 

Join Date: Jul 2004
Location: USA
Posts: 52
Arrow single quote

Hi

I have a shell script with many lines as below:

comment on column dcases.proj_seq_num is dcases_1sq;
....
....

I want the above script to be as below:

comment on column dcases.proj_seq_num is 'dcases_1sq';

I want to have single quotes like that as above for the entire shell script in the 6th position.

thanks
  #2 (permalink)  
Old 12-01-2007
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,944
It seem to be like output of the script, but not clear

Can you please post sample of the script you had tried ?
  #3 (permalink)  
Old 12-01-2007
fpmurphy's Avatar
fpmurphy fpmurphy is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2003
Location: Florida
Posts: 1,910
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
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:05 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0