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
UNITS-FILTER(1) 					     units-filter User Manual						   UNITS-FILTER(1)

NAME
units-filter - is a parser for physical and chemical quantities SYNOPSIS
units-filter -s -o -l DESCRIPTION
units-filter is a basic standalone parser written in C language, flex and bison. It inputs strings like "1.5e3 nN.m.s^-1" (it could be the time growth ratio of a torque) and outputs the value in standard SI unit, followed by the physical dimension of this value. OPTIONS
-s Like Significant. Takes in account the number of significant digits. For example 1.0 m contains 2 significant digits, while 0.00100 contains 3 significant digits. It is possible to enforce the number of significant digits by using a special syntax : if units-filter parses the input "1.0m#6", it interprets it as a value with exactly 6 significant digits, like "1.00000 m". The number following the # sign is the forced number of significant digits. The number of significant digits appears just before the last zero in the output of the command (this zero is a placeholder for future extensions). -o Like Output. Outputs a correct representation of the physical quantity with its physical unit in the International System notation. There may be some simplification with usual units. For example, a newton will be represented by the unit N in place of m.kg.s^-2. The value is expressed as a floating number with one digit before the decimal point, and as many digits in the mantissa as necessary to fit the desired number of significant digits (see an example below). It is possible to enforce the output unit : just add a colon and the desired unit at the end of the input. If this unit is homogeneous with the former one, it will be used to format the output. -l Like LaTeX. Outputs a correct representation of the physical quantity with its physical unit in the International System notation, in LaTeX language. EXAMPLES
Establish the SI value and unit exponent of a quantity in the mksa system: ~$ echo 1.5e3 nN.m.s^-1 | units-filter 1.5e-6 2 1 -3 0 0 0 0 which means : 1.5e-6 (SI unit) m^2.kg.s^-3 Compare different physical quantities: ~$ e1=$(echo "1.2e-3 V" | units-filter) ~$ e2=$(echo "1200e3 nWb/s"| units-filter) ~$ if [ "$e1" = "$e2" ]; then echo ok; else echo ko; fi ok ... which emphasizes that webers by unit time are the same as volts. Playing with the number of significant digits: ~$ echo "0.00100m" | src/units-filter -s 0.001 1 0 0 0 0 0 0 3 0 ~$ echo "0.00100m #2" | src/units-filter -s 0.001 1 0 0 0 0 0 0 2 0 Giving a value for the relative precision: ~$ echo "1kV~2" | units-filter -o 1e+03 V +-2% Turning on the LaTeX output: ~$ echo "1kohm+-2%" | units-filter -l 1 imes 10^{+03}, Omega pm 2,\% Turning on the output of a canonical physical notation: ~$ echo "1.0 m.kg.s^-2 #7" | units-filter -o 1.000000e+00N Choosing a non-standard unit for the output: ~$ echo 1800C:A.h| units-filter -o 5.000e-01 A.h KNOWN BUGS
Few units out of the mksa system are successfully parsed. AUTHOR
Georges Khaznadar <georgesk@ofset.org> Wrote this manpage. COPYRIGHT
Copyright (C) 2009 Georges Khaznadar Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 or (at your option) any later version published by the Free Software Foundation. On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL. units-filter 11/19/2011 UNITS-FILTER(1)
All times are GMT -4. The time now is 11:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy