Sponsored Content
Full Discussion: loop through configs
Top Forums Shell Programming and Scripting loop through configs Post 302511636 by arun1401 on Thursday 7th of April 2011 09:22:36 AM
Old 04-07-2011
loop through configs

hi All, is there a way in linux to loop thru all variables sourced?
i have a set configs like
A=100
b=200
c=400
i can add the above lines to a file and source - so that $A will be 100 .. like wise

now when i do a cut -c 1-2 file.txt |sort | uniq -c on a file it returns me
A 100
B 50
c 450
d 180

now i want to run thru the config [looking for something like for i in $() - not sure it works with variables]and find the file has any values [A/B/C] has passed the config value
say in this case C has passed 400

please help

---------- Post updated at 08:22 AM ---------- Previous update was at 07:58 AM ----------

think this will work
set -o posix ; set
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

mail configs and linux suse 9

Hello, I am needing to find what smtp server we are using on our linux box that run suse 9 when ever we mail out from the box using the mail command.... I have searched the board and see references to sendmail.cf but can't find this file on our box... I see alot of mail configs in /etc/postfix... (2 Replies)
Discussion started by: benefactr
2 Replies

2. 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

3. Infrastructure Monitoring

Script to sort Cisco configs

Hi everyone :), I need sort Cisco configs to report but i cannot do the script to made this: #### INPUT ##### config-register 0x2102 version 12.2 ! hostname Router ! interface Ethernet0 description Red LAN ip address 192.168.1.1 255.255.255.0 no cdp enable ! interface Serial0... (6 Replies)
Discussion started by: azrael75
6 Replies

4. UNIX for Dummies Questions & Answers

VI - in need of configs/scripts

Hi, I'm somewhat new to unix OS and I'm at course for programmers in my country. and in the course we learn unix and how to script in unix. of course we just started and we learned only the very basic, but I'm a really computer freak and I looking for a way to make the course easier on all of... (8 Replies)
Discussion started by: Bonzay0
8 Replies

5. Red Hat

Sudo command configs

I am wondering how to use SUDO command to allow only my account to run mount command as root. I have root privilege.:confused: (4 Replies)
Discussion started by: almirzaee
4 Replies

6. Shell Programming and Scripting

Array Variable being Assigned Values in Loop, But Gone when Loop Completes???

Hello All, Maybe I'm Missing something here but I have NOOO idea what the heck is going on with this....? I have a Variable that contains a PATTERN of what I'm considering "Illegal Characters". So what I'm doing is looping through a string containing some of these "Illegal Characters". Now... (5 Replies)
Discussion started by: mrm5102
5 Replies

7. Linux

Packages that monitor OS configs and service/ports?

I have several Redhat servers and workstations that I need to be able to monitor for any changes and be notified of any changes to the OS. The features I need to specifically monitor are: ports - opening of new ports that are not already in a whitelist services - any starting or attempts to start... (1 Reply)
Discussion started by: JCDinPGH
1 Replies

8. Shell Programming and Scripting

Expect script to show cisco configs

I know there are better ways to do this. I prefer snmp. I do not have the proper perl modules loaded on the platorm. Snmp isnt loaded on the platform. Telnet is not an option. I need to write an expect script to pull cisco equipment configs. The following code is executed once I gain... (0 Replies)
Discussion started by: popeye
0 Replies

9. Shell Programming and Scripting

awk loop using array:wish to store array values from loop for use outside loop

Here's my code: awk -F '' 'NR==FNR { if (/time/ && $5>10) A=$2" "$3":"$4":"($5-01) else if (/time/ && $5<01) A=$2" "$3":"$4-01":"(59-$5) else if (/time/ && $5<=10) A=$2" "$3":"$4":0"($5-01) else if (/close/) { B=0 n1=n2; ... (2 Replies)
Discussion started by: klane
2 Replies

10. AIX

Chef client on VIOs? How do you manage your VIO configs?

I know the VIOs are generally to be treated as an appliance and one should never drop down to oem_setup_env. In reality however, oem is a very useful tool to get the job done. So that leads me into the question of using the Chef client on a VIO. Currently a big push to manage all our *nix... (4 Replies)
Discussion started by: RecoveryOne
4 Replies
sendiso(1)							  Linux IEEE 1394							sendiso(1)

NAME
sendiso - send IEEE 1394 isochronous packets from dump file SYNOPSIS
sendiso [ options ] FILE DESCRIPTION
sendiso takes the dump file FILE as generated by dumpiso(1), extracts the packets and sends them as they were received (in the same order, with the same channel numbers) as fast as possible - timing of the original dump is not preserved. This program does not allocate any isochronous resources but just starts sending. It should not be used in live environments where it might interfere with properly set up isochronous transmissions, it is a debug and performance benchmarking tool. OPTIONS
-l, --loop=COUNT Send dump file COUNT times. Defaults to 1. -i, --infinite Send dump file in an endless loop. -s, --speed=SPEED Send packets at speed SPEED, which can be given as 100, 200 and 400 (in Mbit/s) or abbreviated as 1, 2 and 4. Defaults to 100. -p, --port=PORT Choose port PORT for sending. A port is a 1394 card or chip and represents one connected bus, therefore this is only relevant when you have multiple of these. Defaults to 0. -h, --help Show help text and exit. BUGS
None known. SEE ALSO
dumpiso(1), isodump(5) AUTHOR
Andreas Bombe <aeb@debian.org> libraw1394 2.1.0 sendiso(1)
All times are GMT -4. The time now is 09:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy