Difference Between executing llike ./myscript.ksh and . ./myscript.ksh
Hi ,
What is the diffence between executing the script like
I have found 2 difference but could not find the reason
1. If i export a variable in myscript.ksh and execute it like . ./myscript.ksh the i can access the other scripts that are present in same directory. But when i execute like ./myscript.ksh then its not availble.
2. If i call a another script from myscript.ksh like . ./myscript_child.ksh and if myscript_child.ksh exits with a due to error i am not able to catch the error code in myscript.ksh but when is call it like ./myscript_child.ksh then i am able to catch the error code
Regards ,
Digvijay Singh
Last edited by Franklin52; 03-21-2011 at 07:45 AM..
Reason: Please use code tags, thank you
Hi all,
I'm developing a system which requires me to run a ksh script from within a cgi script. What sort of syntax will I need to do this, I'm sure it's simple but can't find out how anywhere!
Thanks. (1 Reply)
In a ksh script on an AIX box running a jillion oracle database processes, I'm setting a variable to one of two possible arguments, depending on cmd line arguments.
FINDIT="ps -ef | grep oracle | grep DBexport | grep rshrc"
-or-
FINDIT="ps -ef | grep oracle | grep prod | grep runback"
I... (3 Replies)
Hi,
I'm new to unix scripting.How can i call a script from another script.
I have a.ksh and b.ksh .I have to call b.ksh from a.ksh after it is successfully exceuted.
I tried using
#!/bin/ksh -x in a.ksh and at the end i have used /path/b.ksh
My problem is it is executing only a.ksh.it... (6 Replies)
Hi,
I am a new bie to unix shell programming. I have specified ksh as the first line in my script but when executed it complains.
*********** Script=test********************
#!/usr/bin/ksh
echo hello
print -p 123
************************************
++++++++ Execution... (7 Replies)
Hi All,
I wrote a script to send a mail if a particular logfile did not get updated since 5 mins. Here is the Script.
log=`date +%e_%b_%Y`.log # returns todays logfile
x=`date -r $log` # returns last modification time of the Log file
h1=`expr substr "$x" 12 2`
m1=`expr substr "$x" 15 2`... (5 Replies)
Hi,
I am in ksh.
below mentioned 3 commands I executed at command prompt & got the expected results.
csh
source csh_infa
<special command>
Now I have to do this in the script in ksh. I entered it as it is.
#!/bin/ksh
csh
source csh_infa
<special command>
Now after... (1 Reply)
I have a question about the following
what is the difference between running myscript vs . myscript vs exec myscript ?
I know that when you just run myscript it will fork a child process and run the script and exits.
What does the . myscript and exec myscript do and why is it different and... (1 Reply)
I am trying to call a ksh script from another ksh script.
in the called script , i am doing sum calculation(used typeset etc)
suppose a.ksh is the calling script and b.ksh is the called script .
. b.ksh (used this inside a.ksh)
this execution gives some error like bad number.
but when i... (1 Reply)
Hello,
I have two "for loops" in my script and the second one is not executing the way i want.
Script:
#!/bin/ksh
IFS=' '
printf "Enter Account name: "
read A B C D E F G H I J K L M N O
for i in ${A} ${B} ${C} ${D} ${E} ${F} ${G} ${H} ${I} ${J} ${K} ${L} ${M} ${N} ${O};... (3 Replies)
Discussion started by: seekryts15
3 Replies
LEARN ABOUT LINUX
let
let(1) User Commands let(1)NAME
let - shell built-in function to evaluate one or more arithmetic expressions
SYNOPSIS
ksh
let arg...
DESCRIPTION
ksh
Each arg is a separate "arithmetic expression" to be evaluated.
EXIT STATUS
The following exit values are returned:
0 The value of the last expression is non-zero.
1 The value of the last expression is zero.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO ksh(1), set(1), typeset(1), attributes(5)SunOS 5.10 15 Apr 1994 let(1)