The shell script is not returning proper result


 
Thread Tools Search this Thread
Operating Systems AIX The shell script is not returning proper result
# 1  
Old 01-22-2008
The shell script is not returning proper result

Can anybody pls look into this script and tell me where I went wrong. After running this script, it is showing like "Trying to overlay current working directory ABORT!!!"
:-(


ARGCNT=$#
if [ "${ARGCNT}" -ne 2 ]
then
echo "Two parameters are needed for this shell "
echo "Please try again with the following parms: "
echo "first parm = release "
echo "second parm = fully qualified tar file name "
echo " "
exit 1
else
RELEASE=$1
TARFILE=$2
fi

###############################################################
### verify release exists
###############################################################
if [ ! -d ~/${RELEASE} ]
then
echo "Release ${RELEASE} does not exist!"
echo "Verify parameters and try again"
echo " "
exit 1
fi

#######################################################
### verify tar file exists
#######################################################
if [ ! -a ${TARFILE} ]
then
echo "Tar file ${TARFILE} does NOT exist!"
echo "Verify parameters and try again"
echo " "
exit 1
fi
if ll ~/active | grep ${RELEASE}
then
echo "Trying to overlay current working directory ABORT!!!"
exit 99
else
cd ~/${RELEASE}
chmod -R u+w *
zcat ${TARFILE} | tar xvf -
chmod -R u-w *
echo " "
echo "loadTarFile.sh DONE"
fi
# 2  
Old 01-25-2008
What are you trying to do test with:

if ll ~/active | grep ${RELEASE}
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Find commmand returning search path with the result set

OS Platform : Oracle Linux 6.5 We are creating a shell script to purge old log files . It uses find command with rm in it. The syntax is find <Path of Log Directory> -exec rm -fr {} \; Example: find /tmp/test3 -exec rm -fr {} \; For rm command , we use -r option to... (4 Replies)
Discussion started by: kraljic
4 Replies

2. Shell Programming and Scripting

Changes in code to provide proper result with one additional fiield

Hi all I am using following code to get results for brand name drug target name and generic name from my attached fiile awk 'k>0 {if (a && k==2) {print a":"a":"a; a=a=a="";} a=a?a","$0:$0; k=0;} /^# Drug_Target_.*_Gene_Name/ {k=3;} /^# Generic/ {k=1;} /^# Brand_Name/ {k=2;} END {if (a)... (1 Reply)
Discussion started by: manigrover
1 Replies

3. Shell Programming and Scripting

Returning to shell from previous script

Found myself stuck on this seemingly trivial issue. I have this script which call other shell files to do their deeds. The shell files in turn call some other programs as well. My problem is that in two of these shell files, the control doesnt return to next command in script unless the Enter key... (2 Replies)
Discussion started by: DoesntMatter
2 Replies

4. Shell Programming and Scripting

issue invoking shell script using cron, even with proper file permission

I am using tcsh what could possibly be a problem, when using crontab to invoke a shell script. ? The script has the read, write and execute permission to all users. And the script works as expected while executing it in stand-alone mode. Is there a way to trace (like log) what error... (9 Replies)
Discussion started by: vikram3.r
9 Replies

5. Shell Programming and Scripting

Shell script: returning the file with the most lines

Hey I am relatively new to Linux and shell scripting, looking for a spot of help with a script I am working on. I am writing a script that counts the number of lines in all the files in a directory, sorts them by line number and then returns ONLY the file with the most lines. Right now I can... (11 Replies)
Discussion started by: Breakology
11 Replies

6. UNIX for Advanced & Expert Users

transporting scripts onto sloaris, executing it and returning the result to windows

Hi, I have to write a windows XP program, that would generate a Solaris Script, which would then be transported to Solaris, executed, the execution result then needs to be returned to the XP program. For transporting the file i was thinking of following FTP (admins rejected it) or File share on... (1 Reply)
Discussion started by: 00262881
1 Replies

7. Programming

Returning Strings from C program to Unix shell script

Hi, I'm having a requirement where I need to call a C program from a shell script and return the value from the C program to shell script. I refered a thread in this forum. But using that command in the code, it is throwing an error clear_text_password=$(get_password) Error: bash:... (24 Replies)
Discussion started by: venkatesh_sasi
24 Replies

8. Shell Programming and Scripting

returning to the parent shell after invoking a script within a script

Hi everybody, I have a script in which I'm invoking another script which runs in a subshell. after the script is executed I want to return to the parent shell as some variables are set. However i'm unable to return to my original shell as the script which i'm calling inside is invoked in... (5 Replies)
Discussion started by: gurukottur
5 Replies

9. UNIX for Advanced & Expert Users

find command not returning any result

I am looking for all the header files (*.h).. which as per documentation of the UNIX system shouldbe there. I am using find / -name *.h -print But it does't give anything. My question is under what condition the "find" condition will fail to find the file? What is the work around. ... (4 Replies)
Discussion started by: rraajjiibb
4 Replies

10. Shell Programming and Scripting

Returning Values (shell Script)

I have an application on Informix 4GL, and I am invoking the shell script from the program, but I need to know if the shell script work fine or not, in order to continue the process. I know that we can use $? to get the final status but this is on unix command. How can I return a value from the... (3 Replies)
Discussion started by: jennifer01
3 Replies
Login or Register to Ask a Question