|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
I'm trying to make the below script work!!
The output of the sybase part of the script wpuld be as below (note the space in first position and a blank line at the end) " jackson michael presly Elvis " #!/bin/ksh tmp1=`$SYBASE/bin/isql -Usa -Psybase << EOF | tail +3 |grep -v affected use cust go select lname,fname from customer where cust_id = 5 go EOF` i=0 for tmp in $tmp1 do # I need to get the lname and fname from each row and store it in a local variable # The local variable name uses 'i' value to be unique # How do i do it?????? lname$i = $tmp fname$i = $tmp $i++ done I need to get the two strings from the line and store it in a variable. How to separate the values???? |
|
#2
|
|||
|
|||
|
If you always get a first name and a last name try:
Code:
change this: lname$i = $tmp fname$i = $tmp to this: IFS=" " echo $tmp | read lname$i fname$i IFS= .............. |
|
#3
|
|||
|
|||
|
It didnt work for me..
It didnt work..maybe i did something wrong..
I got it working using set $tmp lname$i=`print "$1"` fname$i=`print "$2"` But when i do a echo $lname$i it gives an error Can i pass this value as argument to perl script using $lname$i??? And another fundamental thing,how do i increment the $i variable. i tried i=$i+1 It didnt work ![]() |
|
#4
|
|||
|
|||
|
a=1
let a++ read: man ksh |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > ksh scripting solaris..newbie prob |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|