Sponsored Content
Full Discussion: Korn Shell Errors
Top Forums UNIX for Dummies Questions & Answers Korn Shell Errors Post 56617 by chambala5 on Wednesday 6th of October 2004 11:38:52 AM
Old 10-06-2004
Korn shell errors

My script seems to be working fine but the out put seems to be hanging and only processes the first set of files an error also comes up to say awk :can't open /opt/lonsched/data/factset/pabatch/check/1global_daily.tag

ERROR MESSAGE FROM LOG FILE:

16:11:21> PROCESSING THE FIRST FILE
awk: can't open /opt/lonsched/data/factset/pabatch/check/1global_daily.tag
16:11:21> searching for ___
Daily/test/Ceurope/EuropeFactset/YTD/
Daily/test/Ceurope/EuropeFactset/
Daily/test/Ceurope/EuropeFactset/YTD/
Daily/test/Ceurope/EuropeFactset/

The script itself is as follows:

SCRIPT

Set up basic environment

#delete the log file we want a clean one
rm /opt/lonsched/log/pabatching.log

#set the log file up
logfile=/opt/lonsched/log/pabatching.log
[ -z ${logfile} ] && logfile=/dev/tty
export logfile

exec 1>> ${logfile}
exec 2>&1

printLog "Setting environment parameters .." date

. /opt/lonsched/scripts/factset/pabatching_params.ksh
let retstat=$?
if [ ${retstat} -ne 0 ] ; then
exit_handler 101 "Failed to set up environment - unknown mode setting"
fi



# Derive the data file name from the tag file name and make it
# available to runFTP.
#

#lcDate=`date +"%d%b%Y" | tr "[a-z]" "[A-Z]"`
lcDate="05OCT2004"

#set up the vars and cal the ftp function
paftpPramFile='pa_batch_get.cfg'
paftpcommand=GET
padataname=1global_daily_$lcDate
pafileExt=.tag_zip
paftptransmethod=ascii

#export the vars
export paftpcommand
export padataname
export pafileExt
export paftptransmethod

#call the ftp function
ftpfile

##get the second tag_zip file
padataname=2global_daily_$lcDate
export padataname
pafileExt=.tag_zip
export pafileExt
#call the ftp function
ftpfile


##more more the lst file into the first tag_zip this wil give us the whole list
#of zip file to ftp over

more ${palocal_check}/2global_daily.tag_zip >> ${palocal_check}/1global_daily.tag_zip


##change the windows file to UNIX
copyWinToUnix



#We now need to bring down all the zip files listed within the /1global_daily.t
#ag_zip file
ftpzipfiles

##This is where we do the searching and placing of the files from the dirs.txt .
#...

##first set up the vars
printLog "PROCESSING THE FIRST FILE "
padataname=1global_daily
export padataname
pafileExt=.tag
export pafileExt
getfilesandcopy ${palocal_check}/${padataname}.tag

##do the second file
printLog "PROCESSING THE SECOND FILE "
padataname=2global_daily
export padataname
pafileExt=.tag
export pafileExt
getfilesandcopy ${palocal_check}/${padataname}.tag

printLog "Finished Processing .." date

ITS HANGING AT PROCESSING FIRST FILE AND CANNOT PROCEED ANY IDEAS AS TO WHERE I SHOULD LOOK
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Korn Shell

Hi I am new to shell programming. I need help to write a script to monitor a process on Sun OS. If the process fails then call a oracle procedure. i check the process if running by typing ps -ef | grep ESP | grep -v grep root 29002 1 0 Mar 18 ? 7:20... (4 Replies)
Discussion started by: gpanesar
4 Replies

2. Shell Programming and Scripting

KORN Shell - Spawn new shell with commands

I want to be able to run a script on one server, that will spawn another shell which runs some commands on another server.. I have seen some code that may help - but I cant get it working as below: spawn /usr/bin/ksh send "telnet x <port_no>\r" expect "Enter command: " send "LOGIN:x:x;... (2 Replies)
Discussion started by: frustrated1
2 Replies

3. Shell Programming and Scripting

how to convert from korn shell to normal shell with this code?

well i have this code here..and it works fine in kornshell.. #!/bin/ksh home=c:/..../ input=$1 sed '1,3d' $input > $1.out line="" cat $1.out | while read a do line="$line $a" done echo $line > $1 rm $1.out however...now i want it just in normal sh mode..how to convert this?... (21 Replies)
Discussion started by: forevercalz
21 Replies

4. UNIX for Dummies Questions & Answers

bourne shell or korn shell?

Hi, I have a script that uses "nohup" command to execute a korn shell script. Which one is the correct shell to use bourne shell or korn shell to execute a korn shell? and why? Thanks in advanced. (2 Replies)
Discussion started by: XZOR
2 Replies

5. Shell Programming and Scripting

how can i call one korn shell from a shell

Hi guys, please help me I have a ksh script (second picture down), in that script I define the function DATECALC. Now I want to use this function KSH in a program shell. How can I call this ksh from my shell program? My shell program is... in the first two lines I tried to call... (1 Reply)
Discussion started by: acevallo
1 Replies

6. Shell Programming and Scripting

korn shell

I am using korn shell but I want to have my prompt to represnent that of my C shell because I like it better. Is there anyway to do this? (1 Reply)
Discussion started by: vthokiefan
1 Replies

7. Shell Programming and Scripting

How to activate Korn Shell functionnalities in Bourne Shell

Hi All I have writing a Korn Shell script to execute it on many of our servers. But some servers don't have Korn Shell installed, they use Borne Shell. Some operations like calculation don't work : cat ${file1} | tail -$((${num1}-${num2})) > ${file2} Is it possible to activate Korn Shell... (3 Replies)
Discussion started by: madmat
3 Replies

8. Shell Programming and Scripting

Bourne shell & Korn shell

Could some one tell me the difference btw Bourne shell and the Kshell? Which is more flexible and reliable in terms of portability and efficiency. When i type the following command .. $ echo $SHELL yields me /bin/sh Does this tells me that I am in Bourne shell. If yes, how can i get... (6 Replies)
Discussion started by: bobby1015
6 Replies

9. Shell Programming and Scripting

XDOLoad.sh Korn shell errors out while loading

Hi All, O/S :AIX 6.1 64 bits The following shell script errors out while loading: cat XDOLoad.sh #!/usr/bin/ksh %s_contextfile% %s_adjvaprg% oracle.apps.xdo.oa.util.XDOLoader UPLOAD -DB_USERNAME %s_apps_user% -DB_PASSWORD ${1} -JDBC_CONNECTION... (8 Replies)
Discussion started by: a1_win
8 Replies

10. Shell Programming and Scripting

New to korn shell

I am new to korn shell and slowly learning. Is there a way to have a parent script prompt for input and then execute a child script and return the output then move forward and ask for more input and then execute the next child script? I think the answer is no but thought i would ask. (2 Replies)
Discussion started by: cptkirkh
2 Replies
shell_builtins(1)														 shell_builtins(1)

NAME
shell_builtins, case, for, foreach, function, if, repeat, select, switch, until, while - shell command interpreter built-in commands The shell command interpreters csh(1), ksh(1), and sh(1) have special built-in commands. The commands case, for, foreach, function, if, repeat, select, switch, until, and while are commands in the syntax recognized by the shells. They are described in the Commands section of the manual pages of the respective shells. The remaining commands listed in the table below are built into the shells for reasons such as efficiency or data sharing between command invocations. They are described on their respective manual pages. | Command | Shell alias |csh, ksh bg |csh, ksh, sh break |csh, ksh, sh case |csh, ksh, sh cd |csh, ksh, sh chdir |csh, sh continue |csh, ksh, sh dirs |csh echo |csh, ksh, sh eval |csh, ksh, sh exec |csh, ksh, sh exit |csh, ksh, sh export |ksh, sh false |ksh fc |ksh fg |csh, ksh, sh for |ksh, sh foreach |csh function |ksh getopts |ksh, sh glob |csh goto |csh hash |ksh, sh hashstat |csh history |csh if |csh, ksh, sh jobs |csh, ksh, sh kill |csh, ksh, sh let |ksh limit |csh login |csh, ksh, sh logout |csh, ksh, sh nice |csh newgrp |ksh, sh nohup |csh notify |csh onintr |csh popd |csh print |ksh pushd |csh pwd |ksh, sh read |ksh, sh readonly |ksh, sh rehash |csh repeat |csh return |ksh, sh select |ksh set |csh, ksh, sh setenv |csh shift |csh, ksh, sh source |csh stop |csh, ksh, sh suspend |csh, ksh, sh switch |csh test |ksh, sh time |csh times |ksh, sh trap |ksh, sh true |ksh type |ksh, sh typeset |ksh ulimit |ksh, sh umask |csh, ksh, sh unalias |csh, ksh unhash |csh unlimit |csh unset |csh, ksh, sh unsetenv |csh until |ksh, sh wait |csh, ksh, sh whence |ksh while |csh, ksh, sh Bourne Shell, sh, Special Commands Input/output redirection is now permitted for these commands. File descriptor 1 is the default output location. When Job Control is enabled, additional Special Commands are added to the shell's environment. In addition to these built-in reserved command words, sh also uses: : No effect; the command does nothing. A zero exit code is returned. .filename Read and execute commands from filename and return. The search path specified by PATH is used to find the directory con- taining filename. C shell, csh Built-in commands are executed within the C shell. If a built-in command occurs as any component of a pipeline except the last, it is exe- cuted in a subshell. In addition to these built-in reserved command words, csh also uses: : Null command. This command is interpreted, but performs no action. Korn Shell, ksh, Special Commands Input/Output redirection is permitted. Unless otherwise indicated, the output is written on file descriptor 1 and the exit status, when there is no syntax error, is zero. 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 vari- able assignment. This means that tilde substitution is performed after the = sign and word splitting and file name generation are not performed. In addition to these built-in reserved command words, ksh also uses: * : [ arg ... ] The command only expands parameters. * .file [ arg ..Read the complete file then execute the commands. The commands are executed in the current shell environment. The search path specified by PATH is used to find the directory containing file. If any arguments arg are given, they become the posi- tional parameters. Otherwise, the positional parameters are unchanged. The exit status is the exit status of the last com- mand executed. the loop termination test. intro(1), alias(1), break(1), cd(1), chmod(1), csh(1), echo(1), exec(1), exit(1), find(1), getoptcvt(1), getopts(1), glob(1), hash(1), his- tory(1), jobs(1), kill(1), ksh(1), let(1), limit(1), login(1), logout(1), newgrp(1), nice(1), nohup(1), print(1), pwd(1), read(1), read- only(1), set(1), sh(1), shift(1), suspend(1), test(1B), time(1), times(1), trap(1), typeset(1), umask(1), wait(1), chdir(2), chmod(2), creat(2), umask(2), getopt(3C), profile(4), environ(5) 29 Jun 2005 shell_builtins(1)
All times are GMT -4. The time now is 09:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy