10 More Discussions You Might Find Interesting
1. 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
2. Shell Programming and Scripting
Hi all,
I have a shell script inside which i am executing another shell script. In the inner script im executing a command. i want the status of that command in the outer script to perform some validations.
How to get its status please help!!1
Im using ksh. (2 Replies)
Discussion started by: Jayaraman
2 Replies
3. 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
4. Shell Programming and Scripting
Is there a way in the following CShell code to have ftp give an exit status that can be retrieved to determine if it succeeded or failed?
ftp -n logxx.xxxx.xxx.xxx.com <<DO_FTP1
quote user $user_name
quote pass $password
ascii
put $js_file_name
bin
put $FinalZipFile
quit
DO_FTP1
... (1 Reply)
Discussion started by: phudgens
1 Replies
5. Shell Programming and Scripting
ftp automation code is
ftp -v -n -i $host_name << EOF
user $u_name $u_pass
bi
mput $tar_file
bye
EOF
How to check whether the file is successfully transfered or not. Suppose the user name or password is provided wrongly then the code should track the error and ask the end user to enter... (2 Replies)
Discussion started by: Dip
2 Replies
6. Shell Programming and Scripting
Hi All,
I am using the following code to move files from one folder to another on the remote server:
ssh username@server <<EOF
cd source_dir
find . -type f -name "*.txt" |xargs -n1000 -i{} mv {} dest_dir
if
then send mail indicating error
otherwise
echo "success"
fi
EOF
... (10 Replies)
Discussion started by: visingha
10 Replies
7. UNIX for Dummies Questions & Answers
Hi All,
I am using the following code to move files from one folder to another on the remote server:
ssh username@server <<EOF
cd source_dir
find . -type f -name "*.txt" |xargs -n1000 -i{} mv {} dest_dir
if
then send mail indicating error
otherwise
echo "success"
fi
EOF
... (1 Reply)
Discussion started by: visingha
1 Replies
8. Shell Programming and Scripting
Hi,
I have tried with the following code;
if ;then
echo "Failure."
else
echo "Success."
fi
to test the exit status of the test.ksh shell script. But whatever is the exit status of the test.ksh shell script Failure. is always printed.
Please help.
regards,
Dipankar. (2 Replies)
Discussion started by: kdipankar
2 Replies
9. Shell Programming and Scripting
I am trying to perform some error handing within a Korn sheel script whilst FTPing a file from one server to another..
The exit status is correctly set to zero, if my script connects to the other server and sends the file..
However, if for whatever reason other than a timeout the script... (3 Replies)
Discussion started by: frustrated1
3 Replies
10. UNIX for Advanced & Expert Users
Does ftp from unix have an exit status. In the sense after ftp is invoked and if the ftp fails during file transfer does it exit out with a status other than 0. What is do right now is invoke ftp and right it to a log and then grep for 'File Transferred Sucessfully'. Is this the only way to do it... (1 Reply)
Discussion started by: oracle8
1 Replies