![]() |
|
|
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 |
| Shell script to create a link | Shreedhar Naik | Shell Programming and Scripting | 3 | 05-22-2008 08:01 AM |
| shell script to create dirs | sjajimi | Shell Programming and Scripting | 2 | 07-24-2007 08:34 AM |
| create a shell script | maykap100 | Shell Programming and Scripting | 3 | 08-31-2005 11:17 PM |
| Shell script to create local homes | Steve Adcock | Shell Programming and Scripting | 11 | 10-25-2004 05:18 AM |
| Shell script to create a DOS-like Menutiem | bionicfysh | Shell Programming and Scripting | 2 | 06-17-2002 05:03 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
create a shell script that calls another script and and an awk script
Hi guys
I have a shell script that executes sql statemets and sends the output to a file.the script takes in parameters executes sql and sends the result to an output file. #!/bin/sh echo " $2 $3 $4 $5 $6 $7 isql -w400 -U$2 -S$5 -P$3 << xxx use $4 go print"**Changes to the table ************" select * from cashflow where label = 'DEALS' go xxx i also have an AWK script that takes the output produced by the script above and generates a csv file from it and sends the output to another file as CSV. BEGIN { count=0; } /^[^(]/ { count+=1 if ( count >1 ){ for (i=1; i <= NF; i = i + 1) printf("%s,",$i); printf("\n"); } } My problem is. 1.how do i call the first script from another shell script passing in the required parameters. 2.how ho i call the AWK script after the output from above to process the file and produce a csv file.this has to be in the same script as the above. 3.my main problem is how to do the above from ONE shell script. 4.some of date being prcessed by the AWK script is in datetime format.the AWK script is seperating the day,month and year with comma.How do i make it treat 23-06-2008 as single field and not as seperate fields. Thanks. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|