Sponsored Content
Full Discussion: having ksh script problems
Top Forums UNIX for Dummies Questions & Answers having ksh script problems Post 7096 by jerzey4life on Tuesday 18th of September 2001 07:51:59 PM
Old 09-18-2001
Network having ksh script problems

well i have written a script to telnet and ftp to all my servers, the script runs great, BUT i can not for the life of me figure out how to get the script to repeat if the conditions are not filled.

this is what i have so far
Code:
#########################################
TorF(){

        echo T for Telnet or F for FTP
        read TF

        if [ $TF = "F" ] || [ $TF = "f" ]
        then
                ftp $IPADD
        fi
        if [ $TF = "T" ] || [ $TF = "t" ]
        then
                telnet $IPADD
        fi


}
##########################################

clear
#
echo "Please Select The site your would like to Telnet/FTP to."
#


echo      1. server1
echo      2. server2

echo "Please Make Your Selection. \c"
        read ANS

        case $ANS in
                '1')
                        IPADD='001.001.001.001'
                        ;;
                '2')
                        IPADD='111.111.111.111'
                        ;;
        esac
        TorF

#########################################

what i have been trying to do is have it start again if you do not meet the conditions. but i only want it to do that 2 times, before it will bring you back to a prompt......



I am stumped

any help would be great

added code tags for readability --oombera

Last edited by oombera; 02-18-2004 at 04:04 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Problems with Perl/KSH Web Log Script

Hi, I am writing a series of scripts for work to analyse intranet access logs. All of the scripts do as they should when run individually from the shell, but only when run from certain directories. This sounds like it may be a PATH issue but I am not sure. When I run a certain script, say... (3 Replies)
Discussion started by: mmanders
3 Replies

2. Shell Programming and Scripting

executing a ksh script from another ksh script

Hi, I'm new to unix scripting.How can i call a script from another script. I have a.ksh and b.ksh .I have to call b.ksh from a.ksh after it is successfully exceuted. I tried using #!/bin/ksh -x in a.ksh and at the end i have used /path/b.ksh My problem is it is executing only a.ksh.it... (6 Replies)
Discussion started by: ammu
6 Replies

3. Shell Programming and Scripting

tracing a ksh script within a ksh script

I normally trace a script with the ksh -x <script name> and redirect strderr to file. But if you have a script like the examble below...... vi hairy bear=`grep bear animals` if then ksh more_animals fi If I ksh -x hairy it won't trace "more_animals" unless I put a -x in it. Is... (1 Reply)
Discussion started by: shorty
1 Replies

4. Shell Programming and Scripting

Strange parameter passing problems (KSH)

Hi all, I'm having a rather peculiar problem involving parameter passing with declared functions in my shell script. Hope to get some advice here. A brief description of my code is as follows: However, I'm not getting the results I wanted. If I pass in $rdir, I'm going to end up... (4 Replies)
Discussion started by: rockysfr
4 Replies

5. Shell Programming and Scripting

import var and function from ksh script to another ksh script

Ih all, i have multiples ksh scripts for crontab's unix jobs they all have same variables declarations and some similar functions i would have a only single script file to declare my variables, like: var1= "aaa" var2= "bbb" var3= "ccc" ... function ab { ...} function bc { ... }... (2 Replies)
Discussion started by: wolfhurt
2 Replies

6. Shell Programming and Scripting

autosys/ksh - problems with script

Hi, I'm using autosys and want to set it up that I receive emails when certain jobs start and finish. I don't want to edit each jobs script (ksh) to send a mail at start and finish, I would rather have a single script/job that watches for a trigger when the jobs have started or finished. I... (1 Reply)
Discussion started by: weszardoz
1 Replies

7. Shell Programming and Scripting

KSH script to run other ksh scripts and output it to a file and/or email

Hi I am new to this Scripting process and would like to know How can i write a ksh script that will call other ksh scripts and write the output to a file and/or email. For example ------- Script ABC ------- a.ksh b.ksh c.ksh I need to call all three scripts execute them and... (2 Replies)
Discussion started by: pacifican
2 Replies

8. Solaris

Problems Running KSH on Solaris 10

Hi, I am currently in the process of testing upgrading from Solaris 8 to Solaris 10. one problem i have encountered is when i am running any of my batch scripts. All my scripts start with #! /bin/ksh so that they will excuted in the ksh shell. but the scripts will not run correctly. The... (3 Replies)
Discussion started by: dshakey
3 Replies

9. Shell Programming and Scripting

Problems with ksh

I have the following ksh code and I am passing f="npt06-sr40-syn-dc0p02-32x24drw.mis" For some reason, it's going to the else statement instead of setting optfdrw=1 smptag=$(print -R $f | awk '/smp/') drwtag=$(print -R $f | awk '/drw/') if && ; then # drw tag... (15 Replies)
Discussion started by: kristinu
15 Replies

10. Shell Programming and Scripting

problems with ksh array and find command

set -A allfiles `find $usrhtml -type f` i am trying to populate this array with the find command. It works fine when find is looking through a single directory but when i add a new subdirectory the files in the subdirectory get duplicated. Can anyone help me and fix this so each files in... (1 Reply)
Discussion started by: bjhum33
1 Replies
iptos(4)						     Kernel Interfaces Manual							  iptos(4)

NAME
iptos - Defines the IP Type Of Service (TOS) for FTP and Telnet SYNOPSIS
/etc/iptos DESCRIPTION
The /etc/iptos file configures the Type Of Service (TOS) of the Internet Protocol (IP) used by FTP and Telnet. The TOS field in the Internet datagram is to specify how the datagram should be handled. It is a mechanism to allow control information to have precedence over data. Generally, protocols that are involved in direct interaction with a human should select low delay, while data transfers that involve large blocks of data need high throughput. Finally, high reliability is most important for datagram-based Internet management functions. In the Tru64 UNIX operating system, the ftp and telnet applications and the ftpd and telnetd daemons allow the configuring of TOS values. These applications check to see if the /etc/iptos file exists; if the file exists, the applications obtain the TOS value from the file and use that value to set the TOS field. If the /etc/iptos file does not exist, the applications default to the following TOS values recom- mended by RFC1060: Low delay High throughput Low delay Users who want to configure their own TOS values for the TOS field should provide the /etc/iptos file. Note Most IP routers do not differentiate based on TOS, and therefore providing values other than the default would have no affect. You should not change the default values for FTP and Telnet. Each entry should consist of a single line of the form: Application Proto TOS-bits aliases The entry fields contain the following information: The name of an application TOS entry. The protocol name for which the entry is appro- priate. The TOS value to be set for the entry. A list of aliases that exist for the entry. Items on an entry line are separated by any number of blanks, tabs, or combination of blanks and tabs. A number sign (#) indicates that the rest of the line is a comment and is not interpreted by routines that search the file. Blank lines in the file are ignored. Valid TOS entry names are ftp-control and ftp-data for FTP and telnet for Telnet. The TOS value for the entry should be one of the following hexadecimal numbers, corresponding to TOS bits: Low delay High throughput High reliability If you need to disable the use of TOS bits, because you are having troubling communicating with a TCP/IP host that doe not conform entirely with the IP specification, you can disable the TOS bits by using the the following settings in the /etc/iptos file: # # Format of this file: # Application Proto TOS-bits aliases # ftp-control tcp 0x0 ftp-data tcp 0x0 telnet tcp 0x0 EXAMPLES
The following example shows typical entries in the /etc/iptos file: # # Format of this file: # Application Proto TOS-bits aliases # ftp-control tcp 0x10 ftp-data tcp 0x08 telnet tcp 0x10 RELATED INFORMATION
RFC1060, ftp(1), telnet(1), ftpd(8), telnetd(8) delim off iptos(4)
All times are GMT -4. The time now is 12:00 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy