Sponsored Content
Top Forums Shell Programming and Scripting Function Bug in script - need help Post 302120157 by gzs553 on Monday 4th of June 2007 04:18:03 PM
Old 06-04-2007
Function Bug in script - need help

My script is erroring with: testtapemgr.sh: FTP_RETURNS: not found
I cannot see what I am doing wrong..when it calls that function from the Volume returns function and says taht FTP_RETURNS is not found and exits out of the script. What am I not seeing here?


#### Return Volume Function Section ############
Volume_Returns()
{
echo "Enter Volumes to be returned"; read input
total_ret=`mminfo -q volume=$input -r volume,location,pool,volretent > $ERVTAPE_RET; cat $ERVTAPE_RET | wc -l`
echo "Is this the volume you would like to return.. $input (y/n)"
total_ret=`expr $total_ret - 1`
echo " Please return the tapes listed"| cat $ERVTAPE_RET
read response
if [ $response = "y" ]; then
echo "Please return the following Tape(s)" >>$ERVTAPE_RET
echo " Please return the tapes listed"| cat $ERVTAPE_RET
RETURN_FLAG="y"
CUT_ERVTAPE_FILE;
#EMAIL_ERV_RET;
FTP_RETURNS

else
echo "incorrect response"; Volume_Returns
exit
fi
}

########################### OFFSITE VOLUMES TO BE RETURNED
FTP_RETURNS()
{
echo "In ftp_ret routine"
echo "$ERVTAPE_RTMP File Transferring to $FTP_HOST.................Return_TAPES"
ftp -n $FTP_HOST <<END_FTP_RET
quote USER $FTP_LOGIN
quote PASS $FTP_PWD
put $ERVTAPE_RTMP
put $RETURN_TAPES_RPT
rename $ERVTAPE_RTMP /export/home/legato/tapemgr/rpts/offsite/returns/ERVTAPE_return.tmp
rename $RETURN_TAPES_RPT /export/home/legato/tapemgr/rpts/offsite/returns/returns_erv.rpt$dat
echo $ERVTAPE_RTMP; echo $RETURN_TAPES_RPT
END_FTP_RET
}
clear
tapemgr_Main_Menu
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Can anyone find a bug in this code?? shell script

I have done a script and IT WORKS JUST PERFECT from command line...but in cron it has problems executing... nawk -F"|" ' { s=substr($104,2,18)} {b ++s} END { for (i in b) print i, b } ' $1 > /path/to/files/TranId_w$2 q=`cat /path/to/files/TranId_w$2 | wc -l` echo $q >... (1 Reply)
Discussion started by: amon
1 Replies

2. Shell Programming and Scripting

bash-function with array acting bizarre, bug?

Hello, basically what this script is supposed to do is showing a list of hosts that is given a number, that you will be able to choose from a list. A check is made to verify that the chosen number is within the array and this is where things go bad and I don't know why, bizarre. I've spent... (5 Replies)
Discussion started by: gand
5 Replies

3. Shell Programming and Scripting

Help - Bug: A script to compile two types of data files into two temporary files

Dear other forum members, I'm writing a script for my homework, but I'm scratching all over my head and still can't figure out what I did wrong. Please help me. I just started to learn about bash scripting, and I appreciate if anyone of you can point out my errors. I thank you in advance. ... (3 Replies)
Discussion started by: ilove2smoke
3 Replies

4. Shell Programming and Scripting

SHELL SCRIPT Function Calling Another Function Please Help...

This is my function which is creating three variables based on counter & writing these variable to database by calling another function writeRecord but only one record is getting wrote in DB.... Please advise ASAP...:confused: function InsertFtg { FTGSTR="" echo "Saurabh is GREAT $#" let... (2 Replies)
Discussion started by: omkar.sonawane
2 Replies

5. Shell Programming and Scripting

Bug in Function Call

Can anybody tell me where is the bug in this below mentioned function call. #The String Search File myString="${LOCATION}/config/stringFile.txt" # Functional Usage function usage() { if ; then echo "************************************************************" ... (5 Replies)
Discussion started by: baraghun
5 Replies

6. Shell Programming and Scripting

Sort function UNIX bug ???

Hello there i have a funny behiavor of the sort fonction, i try it out on different Solaris machine and i have the same issue. So i would like to see if there is a rationel explanation here is some data in a file:test.txt ,Test,RSD,RSD_Asset ,Test,RSD,RSD_Credit ,Test,RSD,RSD_Liab... (3 Replies)
Discussion started by: kykyboss
3 Replies

7. Programming

Tweaked getpass() function gives an untraceable bug

I have customized the getpass() as follows: char* my_getpass(const char* str) { struct termios oflags, nflags; static char passwd; /* disabling echo */ tcgetattr(fileno(stdin), &oflags); nflags = oflags; nflags.c_lflag &= ~ECHO; nflags.c_lflag |= ECHONL; ... (3 Replies)
Discussion started by: royalibrahim
3 Replies

8. Shell Programming and Scripting

Will files, creaetd in one function of the same script will be recognized in another function?

Dear All. I have a script, which process files one by one. In the script I have two functions. one sftp files to different server the other from existing file create file with different name. My question is: Will sftp function recognize files names , which are created in another... (1 Reply)
Discussion started by: digioleg54
1 Replies

9. What is on Your Mind?

Small bug in the Quick Editor function in postbit

Hey, There was a small bug in the Quick Editor function in postbit, but I fixed it (basically a double quote was missing from an element id): <div id="post_message_$post" class="neo-message-area">$post</div> Was <div id="post_message_$post class="neo-message-area">$post</div> Should... (1 Reply)
Discussion started by: Neo
1 Replies
echo(3XCURSES)						  X/Open Curses Library Functions					    echo(3XCURSES)

NAME
echo, noecho - enable/disable terminal echo SYNOPSIS
cc [ flag... ] file... -I /usr/xpg4/include -L /usr/xpg4/lib -R /usr/xpg4/lib -lcurses [ library... ] c89 [ flag... ] file... -lcurses [ library... ] #include <curses.h> int echo(void); int noecho(void); DESCRIPTION
The echo() function enables Echo mode for the current screen. The noecho() function disables Echo mode for the current screen. Initially, curses software echo mode is enabled and hardware echo mode of the tty driver is disabled. The echo() and noecho() functions control soft- ware echo only. Hardware echo must remain disabled for the duration of the application, else the behavior is undefined. RETURN VALUES
Upon successful completion, these functions return OK. Otherwise, they return ERR. ERRORS
No errors are defined. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ |MT-Level |Unsafe | +-----------------------------+-----------------------------+ SEE ALSO
getch(3XCURSES), getstr(3XCURSES), initscr(3XCURSES), libcurses(3XCURSES), scanw(3XCURSES), attributes(5), standards(5) SunOS 5.10 5 Jun 2002 echo(3XCURSES)
All times are GMT -4. The time now is 07:30 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy