The UNIX and Linux Forums  

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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
problem with dd command or maybe AFS problem Anta Shell Programming and Scripting 0 08-25-2006 07:10 AM
SSH Problem auth problem budrito UNIX for Advanced & Expert Users 1 03-17-2004 07:12 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 12-07-2007
manas_ranjan's Avatar
Registered User
 

Join Date: Jul 2007
Location: PUNE
Posts: 157
what is problem in this sed ?????

hi champs,

i have created dynamic insert statements , but sed throwing me an error if i do have a blank character inside it.....

my actual string
HTML Code:
insert_config="INSERT INTO CBF_XXXX ( CS_ID, CS_NAME, FIELD_SEP, REC_SEP, FIELDS_NUM, FTPS_FILE, \
>                                 DECSN_FMT_TYPE, DECSN_FIELDS, DECSN_SCHDL_TYPE, DECSN_SCHDL, DECSN_TIME, \
>                                 DECSN_UNITWS, UNIQ_FILE_CONVNS, OUTBOX_RETN, UPDATE_TIME )  VALUES action_list ;"
my dynamic o/p
HTML Code:
echo ${insert_config_str}
('CSPAT191','CSXXXO,NENINETYONENL','|','" "','15','Y','ALL','NULL','DAILY','NULL','13:00','N','N','1',SYSDATE)
but while using the follwoing sed
HTML Code:
insert_config_act=`echo $insert_config | sed -e 's/action_list/'${insert_config_str}'/g' `
i am facing "sed: -e expression #1, char 54: unterminated `s' command"
but not able to trace out.......why ???
if in the insert_config_str if i am going to fill some value at 4th position, hen sed working fine...but here 4th column in blank,, it's throwing me error....


but i need to insert the blank character in that column.....can any one help me out to figure out the problem ????

Last edited by manas_ranjan; 12-07-2007 at 04:18 AM.
Reply With Quote
Forum Sponsor
  #2  
Old 12-07-2007
manas_ranjan's Avatar
Registered User
 

Join Date: Jul 2007
Location: PUNE
Posts: 157
solved

i have to use

HTML Code:
insert_config_act=`echo $insert_config | sed -e "s/action_list/${insert_config_str}/g" `
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 07:27 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0