Sponsored Content
Top Forums Shell Programming and Scripting Unix Shell basic loop massive n00b Post 302552109 by Corona688 on Thursday 1st of September 2011 03:54:13 PM
Old 09-01-2011
Check that the length is three. [ "${#STR}" -eq 3 ]

Check that it's all digits. [ -z "${STR/[0-9]*/}" ]

Check that it's not in the file. ! grep $ID user.db #??? not perfect but best I can do without knowing what user.db looks like

So

Code:
STR=""
until [ "${#STR}" -eq 3 ] && [ -z "${STR/[0-9]*/}" ] && ! grep "$STR" user.db > /dev/null
do
         read STR
done

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Absolute n00b questions about Unix / Linux

Hi All, I have absolutely no experince with either one, and would LOVE to start from somewhere! So please guide me to some web sites (beside these great forums of course!) that I can obtain n00b information. (Books, links, resources, etc.) What software OS? should I begin with? I have heard... (2 Replies)
Discussion started by: CodeHunter
2 Replies

2. UNIX for Dummies Questions & Answers

A basic question of FOR loop

Hi, have a basic query. Please see the below code: list="one two three" for var in $list ; do echo $var list="nolist" Done Wht if I want to print only first/ last line in the list Eg one & three Regards er_ashu (3 Replies)
Discussion started by: er_ashu
3 Replies

3. Shell Programming and Scripting

unix shell basic

need some help badly. if i had a file with content of few lines like the followings. 1183724770.651 0.049 137.157.56.169 200 415 GET http://venus/client/clients.xml "text/xml" 1183724770.651 0.049 141.183.101.250 200 415 GET http://venus/client/clients.xml "text/xml" using what command... (1 Reply)
Discussion started by: akagi07
1 Replies

4. Programming

Creating a basic UNIX shell script for chatting

Hey guys, This is quite simply what I'm trying to make: A program that runs in a UNIX terminal that you can output text messages to from another machine. These text messages would be prepended with a customized prompt. I'd also like to have the window spew out random dumps of flavor text not... (1 Reply)
Discussion started by: AcerAspirant
1 Replies

5. Shell Programming and Scripting

Shell Scripting n00b

Hey Guys! I was hoping for some help with a simple script I'm trying to use. I have the script set up to pull some simple information out of a database .txt file and sed it into a preexisting template for assignment cover letters. The problem seems to be someplace in the sed statement but I... (5 Replies)
Discussion started by: BFeicht
5 Replies

6. Shell Programming and Scripting

Help required on basic Unix Bourne Shell Script

Howdy People :), I'm a newbie & its my first question here. I've started learning Unix Bourne Shell scripting recently and struggling already :p Can someone PLEASE help me with the following problem. Somehow my script is not working. Display an initial prompt of the form: Welcome to... (1 Reply)
Discussion started by: methopoth
1 Replies

7. Shell Programming and Scripting

which is the Very basic certification on unix shell scripting?

Hi, I am very new to this forum, can any one tell me which is the very basic certification on unix shell scripting? please give me an advice on this. (1 Reply)
Discussion started by: Manjesh
1 Replies

8. Shell Programming and Scripting

Shell pipeline help for a n00b

I need to read input from a file, and make sure nothing prints after column 72. basically, ignore input after character 72 until the next newline character. Any help is appreciated. I have been searching forever! (10 Replies)
Discussion started by: Gbear
10 Replies

9. UNIX for Dummies Questions & Answers

Basic loop awk/shell script question..

Hi, Sorry if this is a newbie question. I guess you can use either awk or shell script for this sequence of operations, but knowing very little about either of them I'm not sure how I should try to write this. The basic objective is to copy certain files that are scattered all over my... (10 Replies)
Discussion started by: pc2001
10 Replies

10. Shell Programming and Scripting

Basic FOR loop with break

Oracle Linux : 6.4/bash shell In the below I want to break out of the loop when it enters the 5th iteration. #!/bin/bash for i in 1 2 3 4 5 6 do echo "$i" if echo "Oh Nooo... i = $i. I need to stop the iteration and jump out of the loop" then break fi done But, it only... (3 Replies)
Discussion started by: John K
3 Replies
SUMO(1) 							   User Commands							   SUMO(1)

NAME
SUMO - Router for the microscopic road traffic simulation SUMO based on junction turning ratios SYNOPSIS
jtrrouter [OPTION]* DESCRIPTION
SUMO jtrrouter Version 0.15.0 Copyright (C) 2001-2012 DLR and contributors; http://sumo.sourceforge.net Router for the microscopic road traffic simulation SUMO based on junction turning ratios. Configuration Options: -c, --configuration-file FILE Loads the named config on startup --save-configuration FILE Saves current configuration into FILE --save-template FILE Saves a configuration template (empty) into FILE --save-schema FILE Saves the configuration schema into FILE --save-commented Adds comments to saved template, configuration, or schema Input Options: -n, --net-file FILE Use FILE as SUMO-network to route on -d, --taz-files FILE Read (additional) districts from FILE -a, --alternative-files FILE Read alternatives from FILE -f, --flow-files FILE Read flow-definitions from FILE(s) -t, --turn-ratio-files FILE Read turning ratios from FILE(s) Output Options: -o, --output-file FILE Write generated routes to FILE --vtype-output FILE Write used vehicle types into separate FILE --exit-times Write exit times (weights) for each edge Processing Options: --ignore-errors Continue if a route could not be build --unsorted-input Assume input is unsorted --randomize-flows generate random departure times for flow input --max-alternatives INT Prune the number of alternatives to INT --remove-loops Remove loops within the route; Remove turnarounds at start and end of the route --repair Tries to correct a false route --weights.interpolate Interpolate edge weights at interval boundaries --with-taz Use origin and destination zones (districts) for in- and output --max-edges-factor FLOAT -T, --turn-defaults STR Use STR as default turn definition -s, --sink-edges STR Use STR as list of sink edges -A, --accept-all-destinations Whether all edges are allowed as sink edges -i, --ignore-vclasses Ignore road restrictions based on vehicle class --allow-loops Allow to re-use a road Defaults Options: --departlane STR Assigns a default depart lane --departpos STR Assigns a default depart position --departspeed STR Assigns a default depart speed --arrivallane STR Assigns a default arrival lane --arrivalpos STR Assigns a default arrival position --arrivalspeed STR Assigns a default arrival speed --defaults-override Defaults will override given values Time Options: -b, --begin TIME Defines the begin time; Previous trips will be discarded -e, --end TIME Defines the end time; Later trips will be discarded; Defaults to the maximum time that SUMO can represent Report Options: -v, --verbose Switches to verbose output -p, --print-options Prints option values before processing -?, --help Prints this screen -V, --version Prints the current version -W, --no-warnings Disables output of warnings -l, --log FILE Writes all messages to FILE (implies verbose) --message-log FILE Writes all non-error messages to FILE (implies verbose) --error-log FILE Writes all warnings and errors to FILE --stats-period INT Defines how often statistics shall be printed --no-step-log Disable console output of route parsing step Random Number Options: --random Initialises the random number generator with the current system time --seed INT Initialises the random number generator with the given value EXAMPLES
jtrrouter -c <CONFIGURATION> run with routing options defined in file REPORTING BUGS
Report bugs at <http://sourceforge.net/apps/trac/sumo/>. Get in contact via <sumo-user@lists.sourceforge.net>. Copyright (C) 2001-2012 DLR and contributors; http://sumo.sourceforge.net SUMO jtrrouter Version 0.15.0 is part of SUMO. SUMO is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/gpl.html SUMO jtrrouter Version 0.15.0 May 2012 SUMO(1)
All times are GMT -4. The time now is 02:55 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy