Sponsored Content
Full Discussion: Help with multiple for loops
Top Forums Shell Programming and Scripting Help with multiple for loops Post 302887400 by pnara2 on Friday 7th of February 2014 09:56:19 AM
Old 02-07-2014
Thanks to all

Special thanks to chubler. The code worked perfectly. I am trying it out on other hosts now and will also do some extensive testing before I make it more dynamic.

I am planning to make it more dynamic and use this script to do repeated things like clearing cache, files et al on remote hosts.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Multiple for loops within a Menu?

I have program that I want to be able to use I guess you would call them functions.... to run muliple little programs or loops with one menu script. How would I do this. Here is some code I am using. Sorry about the formatting....it doesn't paste well. echo "*****************************... (3 Replies)
Discussion started by: darthur
3 Replies

2. Shell Programming and Scripting

Multiple loops for Load test

Hi All, I am trying to write a bash script that will read a list of numbers from a file, then it needs to use netcat to create a socket connection and pass header/request. I need to limit it to 100 connections. So, after the first set of 100 are fineshed, I need to loop and do it again with... (0 Replies)
Discussion started by: willdev
0 Replies

3. Shell Programming and Scripting

bash scripting: using multiple 'for loops'??

Hey guys, I'm kinda a noob at scripting. I am trying to create a script that uses multiple for loops with the lsiutility to monitor disk health on a system. The script runs, but it will continually echo an infinite number of LogVolumes when there are only 2 per virtual disk on my server. It's... (2 Replies)
Discussion started by: tank126
2 Replies

4. Shell Programming and Scripting

For loops with multiple variables

Hi script gurus. I have need to know how to use for loop with multiple variable. Basically lets take for example /etc/passwd file has following entries The above cat command will basically first greps the real users that have email addresses then converts ':' to '+' then using cut... (4 Replies)
Discussion started by: sparcguy
4 Replies

5. Shell Programming and Scripting

multiple while loops in expect script

Hi, I am trying to incorporate multiple while loops into an expect script written in ksh shell. This is on a Solaris 10 system. Here is the code: #!/bin/ksh EXPECT=/usr/local/bin/expect exp_internal i=1 h=0 while ]; do $EXPECT << DONE set stty_init raw ... (1 Reply)
Discussion started by: cic
1 Replies

6. Shell Programming and Scripting

help with multiple loops in shell script

Hi Guys- I'm trying to write a script which takes date as input (mm.yy.dd) and search in the current file. If pattern doesn't exist it will then look in a backup directory and so on. being a newb i'm unable to loop over to the backup directory. hoping for some ideas, i've highlighted the... (1 Reply)
Discussion started by: Irishboy24
1 Replies

7. UNIX for Dummies Questions & Answers

While Loops Multiple File

Guru, I try to make a loop of 2 files, Input File1.txt: 1 2 File2.txt: A B C A, B and C is a file name, inside A X Y Z Expected Output A.1 X (2 Replies)
Discussion started by: guns
2 Replies

8. Shell Programming and Scripting

Using grep with multiple loops in reading files

I am trying to read a file line by line and then search that line in another file and get a particular column from the second file. I have written this code.but its not working properly #!/bin/sh while read keyword in duplicate.txt do echo $keyword while read line do ... (7 Replies)
Discussion started by: Prachi Gupta
7 Replies

9. UNIX for Dummies Questions & Answers

Need help with for loops

Why wont my for statements work? Im trying to get this script to swich to a user an if you put in a start/stop/or restart paramater to do just that for each user. I commented out the actual start/stop actions to test it just by using echos and not do anything hasty in the environment but it... (0 Replies)
Discussion started by: LilyClaro
0 Replies

10. Shell Programming and Scripting

Ssh to multiple hosts and then run multiple for loops under remote session

Hello, I am trying to login to multiple servers and i have to run multiple loops to gather some details..Could you please help me out. I am specifically facing issues while running for loops. I have to run multiple for loops in else condition. but the below code is giving errors in for... (2 Replies)
Discussion started by: mohit_vardhani
2 Replies
cfengine(8)						      System Manager's Manual						       cfengine(8)

NAME
cfrun - Execute remote cfagents SYNOPSIS
/usr/sbin/cfrun [options] DESCRIPTION
cfengine is a language based system specifically designed for testing and configuring unix-like systems attached to a TCP/IP network. cfrun is a tool for executing one or more remote agents; it contacts the cfservd daemon running on a remote host, which (in turn) starts an authorized agent. Cfrun cannot be used to send instructions to a remote agent, but it can be used to flag certain aspects to the agent's existing policy for special attention.. The command line options for cfrun are slightly unusual. They are separated into three sections: options to the cfrun program, options to the remote cfagent (with some security restrictions) and finally classes or flags to the remote agent. EXAMPLES
cfrun specialhost1 specialhost2 -- --verbose -- solaris In this example, we contact hosts specialhost1 specialhost2 by name, and ask them to execute cfagent with the --verbose flag, if the class solaris is not defined. cfrun specialhost1 --verbose -- -- solaris In this example the verbose flag is sent to cfrun rather than to the remote agent. No options are sent to the remote agents. The class specifier is sent to all the agents so that they may determine whether they fulfill the required class membership for execution. The default behaviour is to execute cfagent serially on all hosts listed in the cfrun.hosts file. FILES
cfrun read a configuration file cfrun.hosts which must contain a list of every potentially contactable host. AUTHOR
Mark Burgess, Oslo University College INFORMATION
http://www.cfengine.org Maintenance Commands cfengine(8)
All times are GMT -4. The time now is 10:36 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy