![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| Storing count(*) into unix variable | mervinboyz | Shell Programming and Scripting | 1 | 03-26-2008 11:14 PM |
| Storing a variable? | hoover90 | Shell Programming and Scripting | 4 | 01-26-2008 09:39 PM |
| storing database query in a variable | debu | Shell Programming and Scripting | 3 | 11-25-2007 07:59 PM |
| Storing the output into a variable | ravi raj kumar | UNIX for Dummies Questions & Answers | 7 | 12-11-2006 09:14 AM |
| storing output of awk in variable | mab_arif16 | Shell Programming and Scripting | 3 | 05-07-2006 06:15 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Storing values in variable
Hi All,
Here is the description of the problem. I am scripting for database access using k-shell on solaris box dbaccess <databasename> - << EOF 2>/dev/null | awk 'BEGIN {FS=" "}\ {printf "%s", $1}' | grep -v "^$" | \ read cnt1 OUTPUT TO PIPE cat WITHOUT HEADINGS select count(*) from <tablename>; /* In the above case the output is static that is we get only one value as the output i amnt bothered abt the value and only the number of values obtained as output - here no of output is always = 1 */ select <col1>, <col2> from <tablename> where <somecondition>; /* In this case, based on the condition the output ---- > that is the no of values generated as output is varying and that in multiples of two ******** My question is how to store all the values in to variables.. preferably arrays as i have stored the output of the first query into variable cnt */ kindly help me with this issue. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|