![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Windows & DOS: Issues & Discussions Questions involving Unix to Windows (Desktop or Server) go here. Any Windows/DOS questions should go here as well. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Unix terminal re-assigned with wrong IP address from window's DHCP | tlee | SUN Solaris | 0 | 03-10-2008 09:44 PM |
| converting ksh scripts to sh | sherkaner | Shell Programming and Scripting | 11 | 09-28-2007 08:39 AM |
| Converting UNIX scripts to DOS | Crozz | Windows & DOS: Issues & Discussions | 2 | 11-28-2006 07:33 AM |
| Converting | seeyou | SCO | 3 | 01-19-2006 10:22 AM |
| Converting Text File into XML using Unix Shell Scripts | Laud12345 | Shell Programming and Scripting | 10 | 02-16-2005 09:35 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
converting ksh scripts--.bat in window's
hi evry one , I did some ksh scripts for file editing in AIX 5.2 ver,
issue is while I was trying to run these scripts in windows box as batch files windows is not recognising the awk part of the ksh script,as it is GNU environment, so any one who can help me will be appreciated. this is the sample ksh script and followed by .bat file , plzz let me know whether my syntax is correct or not in the .bat file #!/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 file ___________________________________ 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 | ||
|
|
|
|||
|
but egrep is working fine , yes it is win pro edition.problem is with awk part , I commented awk part and ran only the egrep its working fine when i am trying to run both its not working , when i changed awk to gawk its recognizing but giving me a syntax error at OFS":" , should there be any other syntax while using characters like ':' .
Quote:
|