Sponsored Content
Top Forums Shell Programming and Scripting How To Run A For Loop In A Remsh? Post 302506242 by LivinFree on Saturday 19th of March 2011 01:33:50 PM
Old 03-19-2011
I'm rather fond of pdsh, which includes pdcp for copying files to/from a large number of nodes.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

remsh and run script

Help! I'm would like to log in su - within a script an contuine to run the commands within the script. Every time I log in as su - I have to exit for the rest of the script to run! e.g. #!/bin/ksh su - oracle ps -ef |grep som <--- doesn't excute command until I log out su oracle.... (1 Reply)
Discussion started by: bugggg
1 Replies

2. Shell Programming and Scripting

The loop does not run as expected

Hi folks, I have the following configuration file: DB_LAYER=NO ADMIN_LAYER=NO RTESUB_LAYER=NO DB_HOST_NAME=tornado ADMIN_HOST_NAME=tornado RTESUB_HOST_NAME=tornado RESPONSE_FILE_SR=/tmp/SR.rsp INSTALL_SR_1=/home/Upgrade_4.7.1/Utilities/Install_SR:Y... (8 Replies)
Discussion started by: nir_s
8 Replies

3. Shell Programming and Scripting

remsh newhost "for loop"

Hi, In ksh how can I execute something like this: remsh newhost "for i in 1 2 3 4 5 do echo file$i; cat file$i; done" I cannot pass the contrl J or enter in th above line which is required by the for loop. Thanks... (1 Reply)
Discussion started by: alantang
1 Replies

4. UNIX for Advanced & Expert Users

remsh inside of while loop

I have a space delimited file containing: hostname OracleSID connectstring I want to loop through the file and execute remsh to check the database processes. cat $filename | while read HOST SID CONNECT do { result=`remsh $HOST "ps -ef | grep pmon_${SID}$| grep -v grep"` if ........ (1 Reply)
Discussion started by: joettacm
1 Replies

5. Shell Programming and Scripting

How To Run AWK via Remsh?

Boy I hope someone can answer this question. I've been beating my head against the wall all day trying to come up with a solution. I have a carrot delimited file that looks like this: ANDERSON^678934^1974^BOB JONES^564564345^1954^ABRAHAM SMITH^47568465^1948^JON If I run this command: awk... (6 Replies)
Discussion started by: Korn0474
6 Replies

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

7. Shell Programming and Scripting

Script for telnet and run one command kill it and run another command using while loop

( sleep 3 echo ${LOGIN} sleep 2 echo ${PSWD} sleep 2 while read line do echo "$line" PID=$? sleep 2 kill -9 $PID done < temp sleep 5 echo "exit" ) | telnet ${HOST} while is executing only command and exits. (5 Replies)
Discussion started by: sooda
5 Replies

8. Shell Programming and Scripting

How to run it in the loop??

I have this code awk -F, ' { C5+=$5 C6+=$6 C7+=$7 C8+=$8 R=$5+$6+$7+$8 T+=R } { print $0,R } END { print... (7 Replies)
Discussion started by: nikhil jain
7 Replies

9. Shell Programming and Scripting

Run the for loop in parallel

I have the below code which runs on multiple databases , but this runs one-after-one. I will need this to run in parallel so that i could save a lot of time. Please help!!! Thanks in advance for Db in `cat /var/opt/oracle/oratab |egrep -v "ASM" |grep -v \# |cut -d\: -f1` do { export... (5 Replies)
Discussion started by: jjoy
5 Replies

10. Shell Programming and Scripting

Trying to run a basic for loop

OS : RHEL 6.1 Shell : Bash I had a similair post on this a few weeks back. But I didn't explain my requirements clearly then. Hence starting a new thread now. I have lots of files in /tmp/stage directory as show below. I want to loop through each files to run a command on each file. I... (8 Replies)
Discussion started by: kraljic
8 Replies
NODEATTR(1)							     NODEATTR							       NODEATTR(1)

NAME
nodeattr - query genders file SYNOPSIS
nodeattr [-f genders] [-q | -c | -n | -s] [-X exclude_query] query nodeattr [-f genders] [-q | -c | -n | -s] -A nodeattr [-f genders] [-v] [node] attr[=val] nodeattr [-f genders] -Q [node] query nodeattr [-f genders] -V [-U] attr nodeattr [-f genders] -l [node] nodeattr [-f genders] -k nodeattr [-f genders] -d genders nodeattr [-f genders] --expand nodeattr [-f genders] --compress DESCRIPTION
When invoked with the -q , -c , -n , or -s arguments, nodeattr reads the genders file and outputs a list of nodes that match the specified query. The nodes are listed in hostlist format, comma separated lists, newline separated lists, or space separated lists respectively. Genders queries will query the genders database for a set of nodes based on the union, intersection, difference, or complement of genders attributes and values. The set operation union is represented by two pipe symbols ('||'), intersection by two ampersand symbols ('&&'), difference by two minus symbols ('--'), and complement by a tilde ('~'). Parentheses may be used to change the order of operations. The -X argument and query can be used to exclude nodes from the resulting output. A query can be replaced with the -A option to cause nodeattr to print all the nodes listed in the genders database. When called with a node name (optional) and attribute name, nodeattr returns 0 to the environment if the node has the attribute; else 1. If -v is present, the attribute name and any value (see below) is printed on the standard output. If a node name is not specified, the local host is assumed. When called with the -Q argument, nodeattr will check if the node name (optional) is met by the attribute and value conditions specified in the query. If the conditions are met, nodeattr returns 0 to the environment; else 1. The query format is identical to the format listed above. If a node name is not specified, the local host is assumed. The -V option causes nodeattr to print all of the values that exist for a particular attribute. Also specifing -U with -V causes nodeattr to print out only unique values for the particular attribute. The -l option causes nodeattr to print the attributes of the specified node. If no node is listed, all attributes in the genders file are listed. The -k option checks the genders file for parse errors and proper formatting. If errors are found, information about the error will be output to standard error. Nodeattr will always check the default genders file, but a different genders file can be specified with the -f option. The -d option allows the specified genders database to be compared to the filename indicated by the -f option or the default genders data- base. The differences contained in the specified database will be output to standard error. The --expand option will take a genders database, expand all hostranges, and output a new genders database. The subsequent database will be identical to the first, but every node will be listed on a separate line. This option may be useful for debugging or determining the difference between databases. The --compress is opposite of the --expand option. It will output a new identical genders database with hostranges of nodes with identical attributes. Depending on the setup of your genders database, the resulting database may be longer or shorter. This option may be useful as a beginning step to compressing an existing genders database. Attribute names may optionally appear in the genders file with an equal sign followed by a value. Nodeattr ignores these values except when the -v option requests that the value, if any, be displayed; and when an attribute is specified on the command line with a value, in which case only an attribute with the specified value in the genders file will match. EXAMPLES
Retrieve a comma separated list of all login nodes: nodeattr -c login Retrieve a hostlist formatted list of all login nodes: nodeattr -q login Retrieve a comma separated list of nodes with 4 cpus: nodeattr -c cpus=4 Retrieve a comma separated list of all login and management nodes: nodeattr -c "login||mgmt" Retrieve a comma separated list of all login nodes with 4 cpus: nodeattr -c "login&&cpus=4" Retrieve a comma separated list of all nodes that are not login or management nodes: nodeattr -c "~(login||mgmt)" To use nodeattr with pdsh to run a command on all fddi nodes: pdsh -w`nodeattr -c fddi` command To use nodeattr in a ksh script to collect a list of users on login nodes: for i in `nodeattr -n login`; do rsh $i who; done To verify whether or not this node is a head node: nodeattr head && echo yes To verify whether or not this node is a head node and ntpserver: nodeattr -Q "head&&ntpserver" && echo yes FILES
/etc/genders SEE ALSO
libgenders(3) LLNL
August 2003 NODEATTR(1)
All times are GMT -4. The time now is 04:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy