10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Team,
i am executing 3 scripts in background from 1 script and i want to send a message once the script gets completed.these scripts usually takes 1 hr to complete.
My sample script is below,
Vi abc.sh
sh /opt/data/Split_1.sh &
sh /opt/data/Split_2.sh &
sh /opt/data/Split_3.sh &
... (3 Replies)
Discussion started by: raju2016
3 Replies
2. Shell Programming and Scripting
Hi All, I am trying a script out that will startup on one of my servers. i wanted to check for RC 0 and if it didnt check out, exit.
Typo- This is BASH (Redhat)
This isnt working, and this is the best way to do error checking I feel. Heres my erorr
./start: line 25: syntax error near... (2 Replies)
Discussion started by: jeffs42885
2 Replies
3. Shell Programming and Scripting
Hi Forum.
I'm running the following awk command to extract the suffix value (pos 38) from the "AM00" record and append to the end of the "AM01" record.
awk 'substr($0,13,4)=="AM00" {SUFFIX = substr($0,38,2)} substr($0,13,4)=="AM01" {$0 = $0 SUFFIX} 1' before.txt > after.txt
Before.txt:... (2 Replies)
Discussion started by: pchang
2 Replies
4. Shell Programming and Scripting
Hey guys, I'm kinda stuck here.. I'm trying to write a script, which should start a short selftest via smartctl, for example
smartctl -t short /dev/sda
and after the test is finished I want it to write the new smartvalues in a logfile.
well... Now I need a return value for wether the... (1 Reply)
Discussion started by: phill971
1 Replies
5. Shell Programming and Scripting
cat test.sh
#!/bin/sh
expect <<- EOF
set timeout 5
spawn ssh -o StrictHostKeyChecking=no lyang0@128.224.178.245 -C mkdir -p /tmp
expect {
"Password:" {send "root\r"}
}
spawn scp -o StrictHostKeyChecking=no /tmp/1 lyang0@128.224.178.245:/tmp/
... (1 Reply)
Discussion started by: yanglei_fage
1 Replies
6. Shell Programming and Scripting
I have a script which runs a script in the background. Now the script running in background returns some variable value and i want to catch return value in the parent script.
e.g.
Parent Script :
#!/bin/bash
./Back.sh &
pid=$!
echo "a=$a"
echo "b=$b"
echo "d=$((a+b))"
wait $pid
... (4 Replies)
Discussion started by: Shaishav Shah
4 Replies
7. Shell Programming and Scripting
I'd like to create an alias that displays my string but leaves my cursor at the end.
Not seeing any examples of this.
One indirect way might be to preload or stuff the history buffer, so I just hit up arrow. (2 Replies)
Discussion started by: tns1
2 Replies
8. Shell Programming and Scripting
Hello!
I have one strange question - let's say I have a long, multiple-line string displayed on the terminal using echo, and I would like to make a carriage return to the beginning of this string, no to the beginning of the last line - is something like that possible? I would like to be able to... (1 Reply)
Discussion started by: xqwzts
1 Replies
9. Shell Programming and Scripting
Hi,
I would like to return the last part of a string in an array of strings in bash.
The array contains in each position the content below:
and I would like to return only the last part of each string.
The correct result would be:
How can I do that in bash using AWK?... (7 Replies)
Discussion started by: anishkumarv
7 Replies
10. Shell Programming and Scripting
Hi,
How to use the return code, for parallel running threads.
Ex-
grep pattern1 file1 file2 file3 file4 &
grep pattern1 file5 file6 file7 file8 &
grep pattern1 file9 file10 file11 file12 &
return_code=$?
if (return_code -eq 0)
then
echo "pattern found"
else
echo... (2 Replies)
Discussion started by: jitendriya.dash
2 Replies