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
times(1)							   User Commands							  times(1)

NAME
times - shell built-in function to report time usages of the current shell SYNOPSIS
sh times ksh times DESCRIPTION
sh Print the accumulated user and system times for processes run from the shell. ksh Print the accumulated user and system times for the shell and for processes run from the shell. On this man page, ksh(1) commands that are preceded by one or two * (asterisks) are treated specially in the following ways: 1. Variable assignment lists preceding the command remain in effect when the command completes. 2. I/O redirections are processed after variable assignments. 3. Errors cause a script that contains them to abort. 4. Words, following a command preceded by ** that are in the format of a variable assignment, are expanded with the same rules as a variable assignment. This means that tilde substitution is performed after the = sign and word splitting and file name genera- tion are not performed. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
ksh(1), sh(1), time(1), attributes(5) SunOS 5.11 15 Apr 1994 times(1)