Sponsored Content
Top Forums Shell Programming and Scripting Help with a For loop and variables Post 302570574 by molnir on Thursday 3rd of November 2011 03:52:18 PM
Old 11-03-2011
Quote:
Originally Posted by Corona688
Some of these things are less than obvious, for sure. I don't know where everyone picks up `cat file` though.
In my case, Google. Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

using variables outside a while loop

Hi Guys, I have a scripts that uses a while loop to read a file and set 2 variables. How can I do this so the variables can be used outside the while loop ? Below is an example....# ./junk2 -m -e user EXE=user master=TRUE DB_TAG=PRODUCT In loop MST=MST=testsvr1:3110 In loop ARGS=... (2 Replies)
Discussion started by: Tornado
2 Replies

2. Shell Programming and Scripting

Is there a better way I could have run this loop. (For loop with two variables)

Sorry for such a dreadful title, but I'm not sure how to be more descriptive. I'm hoping some of the more gurutastic out there can take a look at a solution I came up with to a problem, and advice if there are better ways to have gone about it. To make a long story short around 20K pieces of... (2 Replies)
Discussion started by: DeCoTwc
2 Replies

3. Shell Programming and Scripting

Using variables created sequentially in a loop while still inside of the loop [bash]

I'm trying to understand if it's possible to create a set of variables that are numbered based on another variable (using eval) in a loop, and then call on it before the loop ends. As an example I've written a script called question (The fist command is to show what is the contents of the... (2 Replies)
Discussion started by: DeCoTwc
2 Replies

4. Shell Programming and Scripting

SH: two variables in for loop

Hi, say I have a simple sh script like this: for i in a b c d do for j in 1 2 3 4 do echo "$i $j" done done and the output is a 1 a 2 a 3 a 4 b 1 (20 Replies)
Discussion started by: marcpascual
20 Replies

5. Shell Programming and Scripting

Two variables in a for loop

Can we assign two variables in a for loop? I have an input file: 000301|20100502 835101|20100502 I want to read this file in a for loop and assign values to two different variables. I did this now but did not work for STORE,RUNDATE in `awk -F\| '{print $1,$2}' inputfile ... (4 Replies)
Discussion started by: gpaulose
4 Replies

6. Shell Programming and Scripting

Need help in for loop with 2 variables

Hi, I need help on for loop need to add domain and IP In domain list 1.com 2.com 3.com In Ip list 1.1.0.1 1.2.0.1 1.3.0.1 1.com 1.1.0.1 2.com 1.2.0.1 3.com 1.3.0.1 I need to excute this command (4 Replies)
Discussion started by: ranjancom2000
4 Replies

7. Shell Programming and Scripting

for loop with 2 variables

i am having a file contants as below my requirement is for file in `awk -F "," '{print $8,$9}'` <temp.txt echo "$file" echo "$file">test.txt a=`awk -F "," '{print $1}' `<test.txt b=`awk -F "," '{print $2}' `<test.txt but script reads , i want both the vales for further... (5 Replies)
Discussion started by: sagar_1986
5 Replies

8. Shell Programming and Scripting

Need to loop three variables

Hi, I have a out from a command i need to grep a report. For that i need loop 3 variable for that. How i can loop need help. Symmetrix ID : 123456 Masking View Name : Host16 Last updated at : 04:13:06 PM on Thu Mar 17,2011 Initiator Group Name : Host16 Host... (3 Replies)
Discussion started by: ranjancom2000
3 Replies

9. Shell Programming and Scripting

Loop through variables

I am pretty new to Unix. Trying to pick up some slack while a coworker is out on vacation. Basically the script is working fine however when I go through the testing phase and have to make mods it is a pita. Here is an example of what I have #!/bin/ksh if then echo... (8 Replies)
Discussion started by: biobill
8 Replies

10. Shell Programming and Scripting

Help with variables in loop

Hello, please assist: users="test1 test2" keytest1="abcd" keytest2="dbcd" for i in $users do echo "$key${i}" > fileout done So, my objective is to take the current user (ie test1) in loop and echo its associated keyname (ie keytest1) variable to a file. The echo... (2 Replies)
Discussion started by: motdman
2 Replies
WHOIS(1)							 Debian GNU/Linux							  WHOIS(1)

NAME
whois - client for the whois directory service SYNOPSIS
whois [ -h HOST ] [ -p PORT ] [ -aCFHlLMmrRSVx ] [ -g SOURCE:FIRST-LAST ] [ -i ATTR ] [ -S SOURCE ] [ -T TYPE ] object whois [ -t ] [ -v ] template whois [ -q ] keyword DESCRIPTION
whois searches for an object in a RFC 3912 database. This version of the whois client tries to guess the right server to ask for the specified object. If no guess can be made it will connect to whois.networksolutions.com for NIC handles or whois.arin.net for IPv4 addresses and network names. OPTIONS
-h HOST Connect to HOST. -H Do not display the legal disclaimers some registries like to show you. -p PORT Connect to PORT. --verbose Be verbose. --help Display online help. Other options are flags understood by RIPE-like servers. NOTES
Please remember that whois.networksolutions.com by default will only search in the domains database. If you want to search for NIC handles you have to prepend a ! character. When you do this, the default server becomes whois.networksolutions.com. When querying whois.arin.net for IPv4 or IPv6 networks, the CIDR netmask length will be automatically removed from the query string. When querying whois.nic.ad.jp for AS numbers, the program will automatically convert the request in the appropriate format, inserting a space after the string AS. When querying whois.denic.de for domain names and no other flags have been specified, the program will automatically add the flag -T dn. When querying whois.dk-hostmaster.dk for domain names and no other flags have been specified, the program will automatically add the flag --show-handles. RIPE-specific command line options are ignored when querying non-RIPE servers. This may or may not be the behaviour intended by the user. When querying a non-standard server, command line options which are not to be interpreted by the client should always follow the -- separa- tor (which marks the beginning of the query string). If the /etc/whois.conf config file exists, it will be consulted to find a server before applying the normal rules. Each line of the file should contain a regular expression to be matched against the query text and the whois server to use, separated by white space. The whois protocol does not specify an encoding for characters which cannot be represented by ASCII and implementations vary wildly. If the program knows that a specific server uses a certain encoding, if needed it will transcode the server output to the encoding specified by the current system locale. Command line arguments will always be interpreted accordingly to the current system locale and converted to the IDN ASCII Compatible Encod- ing. Files /etc/whois.conf ENVIRONMENT
LANG When querying whois.nic.ad.jp and whois.jprs.jp english text is requested unless the LANG or LC_MESSAGES environment variables spec- ify a Japanese locale. WHOIS_OPTIONS A list of options which will be evalued before the ones specified on the command line. WHOIS_SERVER This server will be queried if the program cannot guess where some kind of objects are located. If the variable does not exist then whois.arin.net will be queried. SEE ALSO
RFC 3912: WHOIS Protocol Specification RIPE-223: RIPE NCC Database Documentation Detailed help on available flags can be found in RIPE-223 or in the help file which can be obtained with the command: whois -h whois.ripe.net HELP BUGS
The program may have buffer overflows in the command line parser: be sure to not pass untrusted data to it. It should be rewritten to use a dynamics strings library. HISTORY
This program closely tracks the user interface of the whois client developed at RIPE by Ambrose Magee and others on the base of the origi- nal BSD client. I also added support for the protocol extensions developed by David Kessens of QWest for the 6bone server. AUTHOR
Whois and this man page were written by Marco d'Itri <md@linux.it> and are licensed under the terms of the GNU General Public License, ver- sion 2 or higher. Marco d'Itri 20 December 2009 WHOIS(1)
All times are GMT -4. The time now is 04:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy