10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi there,
I'm very used to use set -e to break my scripts if any command exits with a non-zero status.
As a policy, I'm willingly expecting echo hello | grep a to break the script.
The commands test 1 -eq $1 && echo hello exits with a non-zero status if $1 is not 1. BUT... It doesn't break... (2 Replies)
Discussion started by: chebarbudo
2 Replies
2. Shell Programming and Scripting
Hi all,
I am trying to use a script (a.sh) which is calling another script(b.sh).
And I want to use the exit code(set by me) of b.sh in a.sh.
I am using this in b.sh
#!/bin/sh
<-- code -->
if ; then
exit 0
else
exit 1
fiBut... (2 Replies)
Discussion started by: Raj999
2 Replies
3. Shell Programming and Scripting
Hi,
I want to write a script which continuously checking status of a script running in background by nohup command. And if same script is not running then immediately start the script...please help..
i am using below command to run script
nohup system_traps.sh &
but in some... (9 Replies)
Discussion started by: ketanraut
9 Replies
4. Shell Programming and Scripting
I have a script named check which will read the content of a file and check wether those files exist in the current directory. If so it will have the exit status of 0, otherwise it will have 1.
check script:
#!/bin/bash
if ; then #Check there is enough command line parameters.
exit 1... (2 Replies)
Discussion started by: Ray Sun
2 Replies
5. Shell Programming and Scripting
Hi ,
I have a bash script , which does the network configuration. Messages from this script are dumped on console as well as stored in a log file .
This script is invoked from a C code using system call . The script returns different exit code , to indicate different error cases. The... (1 Reply)
Discussion started by: abhirai
1 Replies
6. Shell Programming and Scripting
I am relatively new to scripting. I am trying to develop a script that will
1. Source an executable file as an argument to the script that sets up the environment
2. Run a command "stat" that gives the status of 5 Engines running on the system
3. Check the status of the 5 Engines as either... (0 Replies)
Discussion started by: paslas
0 Replies
7. Shell Programming and Scripting
Hello All
My req is to store the exit status of a command in shell variable
I want to check whether the file has header or not
The header will contain the string
DATA_ACQ_CYC_CNTL_ID
So I am running the command
head -1 $i | grep DATA_ACQ_CYC_CNTL_ID
Now I have to check if... (6 Replies)
Discussion started by: Pratik4891
6 Replies
8. Shell Programming and Scripting
Hi All,
I have developed below script for FTP a file from unix machine to another machine.
ftpToABC ()
{
USER='xyz'
PASSWD='abc'
echo "open xx.yy.zbx.aaa
user $USER $PASSWD
binary
echo "put $1 abc.txt" >> /home/tmp/ftp.$$
echo "quit" >> /home/tmp/ftp.$$
ftp -ivn <... (3 Replies)
Discussion started by: RSC1985
3 Replies
9. Programming
I have a java classpath running inside of a unix shell script. During my testing it will error with lines that show an example like this below.
java.io.FileNotFoundException error
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:129),
... (2 Replies)
Discussion started by: mmcds
2 Replies
10. Shell Programming and Scripting
I hope one of you smart people out there can help me with what seems like a real simple questing but I can't quite figure out.
In a script I am doing a cmp on two files. I am trying to check the exit status with an if statement but can't seem to figure out the syntax. If the exit status is 1 I... (4 Replies)
Discussion started by: PrimeRibAndADew
4 Replies