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 here.

More UNIX and Linux Forum Topics You Might Find Helpful
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

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 11-28-2006
Registered User
 

Join Date: Nov 2006
Posts: 5
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  
Old 11-28-2006
reborg's Avatar
Administrator
 

Join Date: Mar 2005
Location: Ireland
Posts: 3,585
Duplicate thread, thread closed.
Google The UNIX and Linux Forums
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 03:11 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0