help needed on aix ksh


 
Thread Tools Search this Thread
Operating Systems AIX help needed on aix ksh
# 1  
Old 11-28-2006
help needed on aix ksh

i am trying to convert .ksh script to .bat in windows box , it says awk is not recognized as internal or external command.
this is the sample .ksh script , even if i change awk to gawk it does not work its giving me syntax error, at line one ---- it's pointing ":" and "fund:"
some one plzz help.

#!/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

and this is the sample .bat script

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
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help needed - ksh: sed: command garbled:

Hi all, What am I doing wrong here? $ cat test_sed.ksh #!/usr/bin/ksh var="sed -e \'6s/9/6/\' testfile.txt > testfile.txt.2" $var $ ./test_sed.ksh sed: command garbled: \'6s/9/6/\' Thank you! (4 Replies)
Discussion started by: ejianu
4 Replies

2. Red Hat

KSH script help needed ( nice error trap routine ?)

I am running a script that runs a loop and executes a command on ${i} until the end of the for loop. From time to time the command generates an error ( which is good) for example ERROR0005: How can I trap the error and send an email echoing the ${i} variable in the loop and the error ? ... (2 Replies)
Discussion started by: pcpinkerton
2 Replies

3. Shell Programming and Scripting

Help needed in ksh scripting

I got a task to do today, I want to write a script for the following 1) Archive log more than 2 days old 2) Number of days the current Archive logs present 3) Total number of archive logs 4) Size of each archive log 5) When was last successful backup happened? Can I get a general script... (8 Replies)
Discussion started by: Rambo
8 Replies

4. Shell Programming and Scripting

Help needed with KSH and SQL

Hi All I have a problem with one of my scripts which checks for he status of an Oracle database. Here's the script: #!/bin/ksh sqlplus -s '/nolog' <<EOF connect / as sysdba set heading off spool db_status.txt select OPEN_MODE from v\$database / exit EOF db_status=$(more... (4 Replies)
Discussion started by: huskie69
4 Replies

5. AIX

Help needed with AIX 6.1

Hi, We have just purchased an ibm Power 520 express box with AIX 6.1 preloaded onto it. Using a null modem cable we have connected this upto a Windows 2003 server. From this Windows 2003 server we can using hyperterminal connect to it. I can aslo connect to the Advanced System Management... (16 Replies)
Discussion started by: yfayyaz
16 Replies

6. Shell Programming and Scripting

ksh scripting help needed.

I am trying to create a script to manipulate numerous file and at first I thought it would be a simple task but at this point i am ready to break my computer! I am new to unix scripting so hopefully someone out there thinks this is super easy and can help me out! A sample of the problem file is... (2 Replies)
Discussion started by: theqcup
2 Replies

7. Shell Programming and Scripting

Help needed - ksh shell scripting

Hi all, i m new to Unix shell scripting(ksh) i have a requirement, can anyone help me out in this.. spec: i need to move all the files landing in "X" directory to "Y" directory automatically everyday at a particular time.. (5 Replies)
Discussion started by: subbu
5 Replies

8. UNIX for Advanced & Expert Users

Urgent help needed for ksh shell setting

Today I logged as root on my HP-UX server and by mistake executed below command # ksh -i vi Then onwards for every root logging the ksh shell giving wired output to every command e.g # ls kÚ .brw_history .brwpause .brwtmp : : : 1+~H4p+À+~KÑ 1+Ðè d 15kÚ 1d+~èYÑd:ðè½h|À+~èY4:àh|À+ And so... (6 Replies)
Discussion started by: zing_foru
6 Replies

9. AIX

AIX 5.2 Syslog : Help needed

Hi all, I am trying to get the authentication logs of FTP,Telnet,SSH,inetd from the syslog file. But my output for every type of authentications - success & failure keep differing everytime i view them. The output does not show the priority code (emerg, or 0, in any case). How do I get the... (0 Replies)
Discussion started by: kamadana
0 Replies
Login or Register to Ask a Question
IGAWK(1)							 Utility Commands							  IGAWK(1)

NAME
igawk - gawk with include files SYNOPSIS
igawk [ all gawk options ] -f program-file [ -- ] file ... igawk [ all gawk options ] [ -- ] program-text file ... DESCRIPTION
Igawk is a simple shell script that adds the ability to have ``include files'' to gawk(1). AWK programs for igawk are the same as for gawk, except that, in addition, you may have lines like @include getopt.awk in your program to include the file getopt.awk from either the current directory or one of the other directories in the search path. OPTIONS
See gawk(1) for a full description of the AWK language and the options that gawk supports. EXAMPLES
cat << EOF > test.awk @include getopt.awk BEGIN { while (getopt(ARGC, ARGV, "am:q") != -1) ... } EOF igawk -f test.awk SEE ALSO
gawk(1) Effective AWK Programming, Edition 1.0, published by the Free Software Foundation, 1995. AUTHOR
Arnold Robbins (arnold@skeeve.com). Free Software Foundation Nov 3 1999 IGAWK(1)