10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a function to get the executing scripts name.
Script_nm() {
Parent=$( ps -f -p $PPID -o and | tail -l | sed -e 's/ *\{1,\}sh *//' | awk '{print $1}' )
If ; then
Script_nm='bash_test.sh'
Else
Script_nm=$( basename $parent )
Fi
Echo "$script_nm"
Return 0
}
We are calling this ... (4 Replies)
Discussion started by: srilaxman
4 Replies
2. Shell Programming and Scripting
Hi there,
Say I have a list of IPs, I am running scripts on them. If the process hang.
I want to continue with the rest of the IPs.
10.11.1.1
10.11.1.2
10.11.1.3
10.11.1.4
10.11.1.5
10.11.1.6 <-- Process Hangs here
10.11.1.7
10.11.1.8
10.11.1.9
10.11.1.10
10.11.1.11
10.11.1.12
... (11 Replies)
Discussion started by: alvinoo
11 Replies
3. UNIX for Advanced & Expert Users
Hi scripters,
I'm quite used to run commands in the background using & like in:
$ myscript &But this is NOT what I'm trying to do today. What I'm trying to achieve is to run a script the normal way (without &), have my script do a little checkup and then jump to background. Something like:... (5 Replies)
Discussion started by: chebarbudo
5 Replies
4. Shell Programming and Scripting
Hi,
I've come accross a situation where I need to exit from current shell script at the same time I need to start/activate another shell script.
How can I do that in KSH ?? Need help !!
For example, my script is as below
#!/bin/ksh
paramFile="/home/someXfile.lst"
] && <<Here I... (1 Reply)
Discussion started by: R0H0N
1 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I have a script called
bash$> cat -ev setprofile.sh
alias rm='rm -i'$
$
The alias does not take effect unless i run the script as
bash$> . ./setprofile.sh
What do I have to do in-order to simply run (9 Replies)
Discussion started by: shifahim
9 Replies
6. Shell Programming and Scripting
for i in 1 2 3 4 5
do
y='expr $i + 1';
echo $y
done
After running this shell script i want the output to be
2
3
4
5
6
but the result is coming as
expr $i + 1
expr $i + 1 (3 Replies)
Discussion started by: Sambuddha
3 Replies
7. Shell Programming and Scripting
Hi,
i have a script a.sh that calls b.sh
Both take parameters
a.sh
{
b.sh p1 p2 p3
}
b.sh
{
GIVEN_CMD="`basename $0` $@"
echo "${GIVEN_CMD}
}
Now when i run:
a.sh q1 q2
It prints only
a.sh q1 q2
Inside b.sh, how can i print both the script names and their parameters passed? (6 Replies)
Discussion started by: ysrini
6 Replies
8. UNIX for Dummies Questions & Answers
Hi everyone,
Is there a slick way to determine the FULL name of a script that is running?
The variable ${0} just gives the relative path name.
I guess I could just do the following:
FULL_SCRIPT_NAME=${PWD}${0}Although that's pretty simple is there another way that I am missing?
... (4 Replies)
Discussion started by: msb65
4 Replies
9. Shell Programming and Scripting
Hello all,
I'm new to shell programming and need some help. I would like to set up a step within a shell script to trigger another shell script to run, based on the highest return code generated in the current script. For example, if the highes return code value in the current script is less... (1 Reply)
Discussion started by: mmignot
1 Replies
10. Shell Programming and Scripting
How do i run a shell script or perl script with in the context of a current shell.
I know that i can use command source. but we can't pass any arguments to
our script if we use source command as it takes only one argement i.e filename
Is there any way to run a script in the current shell... (5 Replies)
Discussion started by: Naresh Kumar
5 Replies