03-20-2012
Hi!
Quote:
#!/usr/bin/ksh
# ==============================================================================
# Start/Log SH Script
# ==============================================================================
# Parameters
#. $HOME/.profile
. /app/ICSASC00/dts/sh/params.sh
cd $DTS_SH_DIR
LogDir=$DTS_SH_LOG
# log each execution
ThisScriptFullName="$0"
ThisScriptName=`basename $0`
ThisScriptName=${ThisScriptName%.*}
ThisScriptDir=`dirname $0`
ThisScriptLogFullName="$LogDir/$ThisScriptName.log"
#echo ThisScriptLogFullName=$ThisScriptLogFullName
Now=$(date +"%Y_%m_%d_%H_%M_%S")
echo "Execution begin at $Now" >>$ThisScriptLogFullName
RunScriptName=`basename $1`
RunScriptName2=${RunScriptName%.*}
# create log file for each execution
LogName=$RunScriptName2"_"$Now".log"
#echo LogName=$LogName
LogFullName="$LogDir/$LogName"
echo "%LogFullName%"=$LogFullName
echo "$1 $2 $3 $4 $5 $6 $7 $8" >>$ThisScriptLogFullName
echo "log: $LogFullName" >>$ThisScriptLogFullName
!!! call like (/usr/bin/ksh sqlldr rows=1000 userid=$pSourceConStr data=$vFlatFile control=$vCtlFile log=$vLdrLogFile bad=$vLdrBadFile >sqlldr_log.log)
!!! instead of that ($1 $2 $3 $4 $5 $6 $7 $8 >>$LogFullName) !!! this call is in 3.th script
!!! if I comment out this call, works fine
echo "%Return_Prameter%"=$?
echo "%Return_Prameter%"=$? >>$ThisScriptLogFullName
Now=$(date +"%Y_%m_%d_%H_%M_%S")
echo "End at $Now" >>$ThisScriptLogFullName
exit $?
of course I meant to comment out that call not directly from this script but from 3.th script
Quote:
echo "%Return_Prameter%"=$?
echo "%Return_Prameter%"=$? >>$ThisScriptLogFullName
Now=$(date +"%Y_%m_%d_%H_%M_%S") echo
"End at $Now" >>$ThisScriptLogFullName
exit $?
I got the echo-s to file >>$ThisScriptLogFullName
I do not get the echos to display and the exit value.
My question is how can I call the external program to do not redirect the echo-s from display and exit value
Thanks,
Mroki
Last edited by mroki; 03-20-2012 at 03:31 AM..
10 More Discussions You Might Find Interesting
1. AIX
HI
I am trying to write a shell script which accepts two strings from user and finds the matching number of characters in those two
ex:
string 1 abcd
string 2 bcgt
result is bc (matching characters)
pls provide me with a basic script for doing that (1 Reply)
Discussion started by: akmtcs
1 Replies
2. Shell Programming and Scripting
Hi All,
I have this script which doesn't work on AIX ksh shell..
# ! /usr/bin/ksh
grep -irl "6000" /home/applmgr/xyz > file_list_port.log
xargs sed -i 's/6000/6010/g' < file_list_port.log
But this same script has worked perfectly on linux bash shell..
Could anyone please share... (4 Replies)
Discussion started by: a1_win
4 Replies
3. Shell Programming and Scripting
Hello all,
I am currently try to learn the linux operating system as well as some bash programming. I have come across some online course work which has been very helpful, I have been working through some assignments and since I have no teacher to ask I have come to you experts.
So the... (6 Replies)
Discussion started by: g2axiom
6 Replies
4. Shell Programming and Scripting
I have a script that "runs" a script. For example:
./runscript.ksh pcnmc01.ksh
runscript puts pcnmc01.ksh into the background with log output going to the logfile.
After executing the command, I get this output:
Running script in the background: pcnmc01.ksh
Logfile:... (2 Replies)
Discussion started by: Eben Yong
2 Replies
5. Programming
hii friends i m fairy new to c programming.can any one suggest some good websites and some good books for beginner (6 Replies)
Discussion started by: pankajchandel
6 Replies
6. AIX
Hello,
For some time I have intellistation 9111-285 and I installed AIX 6.1 on it. As a complete beginner I have 2 questions in general about AIX and two specific:
1. is the SMS (system management services) part of AIX? As I noticed when I had Yellowdog Linux installed they weren't available?... (2 Replies)
Discussion started by: kenashkov
2 Replies
7. Shell Programming and Scripting
I started to learn KSH
I am doing some exercises from the book
$ umask =rx, u+w
$ print Keep track of everythine > file1.out
$ print Be careful >> file1.out
ksh: file1.out: cannot create
$ umask -S ... (1 Reply)
Discussion started by: solaris_user
1 Replies
8. Shell Programming and Scripting
Hi all,
I'm a fairly new beginner with shell programming and python programming. I have a mac (mountain lion OS 10.8.2) and use the terminal for programming. I'm trying to use the unix to easily organize some language data that I am working with. Basically I have to word lists, that I need to... (2 Replies)
Discussion started by: nomadblue
2 Replies
9. Shell Programming and Scripting
So guys basically I was really sick and couldn't attend the labs and lectures and I went to my lecture hoping he would say ok I will help you from the start but he just said google it. So If it's possible to make the assignment and explain more in detail why is that would be really helpfull.
I can... (1 Reply)
Discussion started by: Joola94
1 Replies
10. Shell Programming and Scripting
My variable contains the following string
I wish to replace \n with "space" so the expected output is:
I understand that the /n is not a new linein this case.
I'm on AIX using ksh shell. Below is all that I tried.
echo $str | sed -e "s#\n# #g";
echo $str | sed -e "s#\n#' '#g";... (5 Replies)
Discussion started by: mohtashims
5 Replies
LEARN ABOUT OPENSOLARIS
noecho
echo(3XCURSES) X/Open Curses Library Functions echo(3XCURSES)
NAME
echo, noecho - enable/disable terminal echo
SYNOPSIS
cc [ flag... ] file... -I /usr/xpg4/include -L /usr/xpg4/lib
-R /usr/xpg4/lib -lcurses [ library... ]
c89 [ flag... ] file... -lcurses [ library... ]
#include <curses.h>
int echo(void);
int noecho(void);
DESCRIPTION
The echo() function enables Echo mode for the current screen. The noecho() function disables Echo mode for the current screen. Initially,
curses software echo mode is enabled and hardware echo mode of the tty driver is disabled. The echo() and noecho() functions control soft-
ware echo only. Hardware echo must remain disabled for the duration of the application, else the behavior is undefined.
RETURN VALUES
Upon successful completion, these functions return OK. Otherwise, they return ERR.
ERRORS
No errors are defined.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |Unsafe |
+-----------------------------+-----------------------------+
SEE ALSO
getch(3XCURSES), getstr(3XCURSES), initscr(3XCURSES), libcurses(3XCURSES), scanw(3XCURSES), attributes(5), standards(5)
SunOS 5.11 5 Jun 2002 echo(3XCURSES)