![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | 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 here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| convert unix script to perl | gholdbhurg | Shell Programming and Scripting | 2 | 03-25-2008 10:42 AM |
| How to execute multiple(batch) oracle script in unix mechine | ravi gongati | Shell Programming and Scripting | 2 | 03-21-2008 04:37 AM |
| UNIX logon script/batch | oht | UNIX for Dummies Questions & Answers | 1 | 09-05-2007 03:04 PM |
| Sample Unix script file to convert .xml to .csv | srinivasaphani | Shell Programming and Scripting | 4 | 08-27-2007 07:04 AM |
| How to write a Script to run series of batch jobs on unix platform | venki311 | Shell Programming and Scripting | 2 | 07-30-2006 11:26 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
how to convert unix .ksh script to windows .batch script
I am using awk in my .ksh script but when I am trying to run in windows
its not recognising awk part of the ksh script , even when I changed it to gawk it does not work, this is how my .ksh and .bat files look like. thanx. #!/bin/ksh egrep -v "Rpt 038|PM$|Parameters:|Begin |Date: |End |Date:|Plan Beginning |Page |Fund |Total|Page|^$" $PMSRC/usi38.txt|awk 'BEGIN{ OFS=":"} { if( match ( $0 , "Fund:" ) ) { split($0,arr,":") cmpny = arr[2] getline ; if( ! match($0 , "Code Balance" ) ) { cmpny = cmpny $0; getline } } else print cmpny , $0 }'>$PMSRC/usi38final.txt ___.bat____ REM #!/bin/ksh egrep -v "Rpt 038|PM$|Parameters:|Begin |Date: |End |Date:|Plan Beginning|Page |Fund |Total|Page|^$" D:\temp\usi38.txt| awk "BEGIN { OFS=":"} { if( match( $0,"Fund:")){ split( $0,arr,":")cmpny = arr[2] getline; if( ! match( $0 ,"Code Balance")) { cmpny = cmpny $0; getline}} else print cmpny,$0}" > D:\temp\usi38final.txt |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Duplicate thread, thread closed.
|
||||
| Google The UNIX and Linux Forums |