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 and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Help concatenation string and variable drain Shell Programming and Scripting 5 02-18-2008 10:21 AM
cannot get logic for concatenation awk user_prady Shell Programming and Scripting 7 12-10-2007 03:09 AM
Concatenation Asteroid Shell Programming and Scripting 11 04-04-2007 07:15 AM
string concatenation systemsb UNIX for Dummies Questions & Answers 7 04-04-2006 01:03 PM
Concatenation videsh77 Shell Programming and Scripting 2 12-14-2004 06:13 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 05-16-2008
arvindcgi arvindcgi is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 14
String concatenation issue in ksh

Hello All,

I'm tryying to concatenate string and variables value in ksh, but i'm unable to do it, can someone please help in rectifying my error,

here is the code i have written,

#!/usr/bin/ksh -x
cat $1 | while read fileline
do
val1= echo $fileline | awk -F, '{print $1}'
val2= echo $fileline | awk -F, '{print $2}'
set sqlstmt = "update Tablename set Varnum1 = $val2 where Date = '$val1' and UId = 1"
#echo $fileline
echo $sqlstmt
#echo $val1
#echo $val2
done


Data there in input file is something like ,

20080401,16540448,52267816,2559665,8088541
20080402,16599900,52455684,2741819,8664148


Any help will be much appriciated, as i have been trying various combination from last few hours like putting the variable name in {} , i.e ${val2}, etc

Thanks,
Arvind.
 

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 08:46 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