10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
Good Day, seeking for your assistance on how to not perform my 2nd, 3rd,4th etc.. function if my 1st function is in else condition.
#Body
function1()
{
if
then
echo "exist"
else
echo "not exist"
}
#if not exist in function1 my all other function will not proceed.... (4 Replies)
Discussion started by: meister29
4 Replies
2. Shell Programming and Scripting
Hello, this is my first post here.
I'm attempting to write a bash shell script to rm the contents of a directory without deleting the directory, specifically in OS X 10.10 . Here's what I have:
function clear() {
USER="$USER"
DIR=$1
rm -rfv /Users/"$USER"/library/$DIR/*
}
clear... (6 Replies)
Discussion started by: YouNicks
6 Replies
3. Shell Programming and Scripting
Hi All,
I am doing an export and import (datapump) of 4 schema. I know we can do an export of 4 schema in one command. But just want to know how to check the exit status if i do the export/import of 4 schema in different commands in background. Please suggest.
Thanks,
Mani (1 Reply)
Discussion started by: pvmanikandan
1 Replies
4. UNIX for Dummies Questions & Answers
Hello All,
I am trying to capture the exit status of find command and want to delete the files only when it is successful. But it is always returning me as success even if the pattern of that file doesn't exist in the current directory. please help, checked manual page but couldn't able to figure... (6 Replies)
Discussion started by: Ariean
6 Replies
5. UNIX for Advanced & Expert Users
Hi,
Want to log the output of command & check the exit status to find whether it succeeded or failed.
> ls abc
ls: abc: No such file or directory
> echo $?
1
> ls abc 2>&1 | tee log
ls: abc: No such file or directory
> echo $?
0
Tee commands changes my exit status to be always... (7 Replies)
Discussion started by: vibhor_agarwali
7 Replies
6. 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
7. HP-UX
I have the question:
How return the exit code from then assign :
VAR=$(command ) for ex. VAR=$(ls ....)
VAREXIT=$?
echo $VAREXIT
VAREXIT is equal to 0 if the directory exist or not exist. WHI??
if i execute the command direct from line-command , the value of $? is different if... (1 Reply)
Discussion started by: ZINGARO
1 Replies
8. Shell Programming and Scripting
Hi to everyone.
How can I get the exit status from a remote command executed with rexec? :eek:
machine A has RedHat Linux 9 and the remote machine B has SCO UNIX.
Code:
rexec -l user -p password host sh /u/files/scripts/seq_cal.sh 2006 08
I want the exit status returned by... (1 Reply)
Discussion started by: zoonalex
1 Replies
9. UNIX for Dummies Questions & Answers
I am executing a find command in my script i.e
find $2 -type f -name '*.gif' -mtime +$1 -exec rm {} \;
how do i check that this command is executed properly.. i would lke t trap the errror and display my error message
kinly help.. this is an urgent issue. (1 Reply)
Discussion started by: vijay.amirthraj
1 Replies
10. Programming
Hi,
I want to find the exit status of the last executed command in C Shell.
Tried $? but getting the error Variable syntax...$? does not seem to work in C shell..
is there any other command in C shell to find the exit status of last command?
Thanks in advance,
raju (1 Reply)
Discussion started by: rajugp1
1 Replies