Sponsored Content
Top Forums Shell Programming and Scripting for loop with multiple variables ? Post 48203 by karthi_tvr on Monday 1st of March 2004 03:07:43 AM
Old 03-01-2004
Hi Smilie

You can achieve this by the following while loop :-

cat mapfile | while read next
do
LIVELV=`echo $next | awk '{print($1)}'`
BCVLV=`echo $next | awk '{print($3)}'`
lvmerge $BCVLV $LIVELV
done
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

While loop with Multiple variables

Hi , I am trying to write a script in kshell with while loop ,its like count=1 count_cmp=1 while ; do tail -$count tempfile | head -1 > tempstring ....... done However i get CIF.sh: line 33: ' I have checked thetrailing spaces , not sure what is... (4 Replies)
Discussion started by: amit1_x
4 Replies

2. UNIX for Dummies Questions & Answers

multiple variables in for loop

hi, I want an equivalent for loop for this C code in unix shell script... for(int i,int j;i<5;i++,j++) { } Please reply soon Regards Navjot (1 Reply)
Discussion started by: navjotsingh
1 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

How to use for/while loop with multiple variables?

Hi, I have two variables like below which will always be of the same size a=1:2:3 b=A:B:C I need to use a for/while loop that will have both the variables available. I cannot use an array here and will probably might iterate through the variable as echo $a | tr ':' '\n' and thus iterate... (5 Replies)
Discussion started by: Elizabeth H
5 Replies

5. UNIX for Dummies Questions & Answers

Multiple variables to be passed in a loop

Hi, I need to pass the multiple values of src1 to another variable. I managed to print it but not sure how to assign it to a variable in a loop. src1=01,02,03 echo $src1|awk 'BEGIN {FS=","} {for(i=1;i<=NF;i++) print $i}' I need to pass the value as src2=01 src2=02 src2=03 Thanks... (4 Replies)
Discussion started by: shash
4 Replies

6. UNIX for Dummies Questions & Answers

Reading multiple variables in a loop

Hi, I managed to read and print variable as shown in the below code. table_name=table1,table2,table3 i=0 IFS="," for i in $table_name do echo $i done Is there a way how I can read more than one variable. For example I need to read 2 variables and populate the output... (6 Replies)
Discussion started by: shash
6 Replies

7. Shell Programming and Scripting

Loop with multiple delimited variables

hi, i need a portion in a audit logging shell script where i have to loop thru multiple variables. I need some help in accomplishing this. i have 3 variables var1=1,23,234 var2=a,ab,xyz var3=0,0,0 the variables will have variables number of values but same length.(3 in this case ) i... (10 Replies)
Discussion started by: rock1
10 Replies

8. Shell Programming and Scripting

Multiple variables using awk and for loop for web form submission

Hi My goal is to fill an HTML form and submit. What I have managed to do: 1. curl command to fill up the form and submit 2. a file which has the input curl command: curl -v -b cookie.txt -d __CSRFToken__=dc23d5da47953b3b390ec68d972af10380908b14 -d do=create -d a=open -d... (10 Replies)
Discussion started by: zorrox
10 Replies

9. UNIX for Beginners Questions & Answers

Displaying multiple variables in for loop

Hi! I've run into a problem where my variables are displayed in the wrong order. Basically I'm supposed to use a file that has information like this username:firstname:lastname:etc:etc. What I'm interested in doing is reformating it into a something more like this: username lastname,... (2 Replies)
Discussion started by: reindeermountai
2 Replies
GRID-MAPFILE-ADD-(8)						  Globus Commands					      GRID-MAPFILE-ADD-(8)

NAME
grid-mapfile-add-entry - Add an entry to a gridmap file SYNOPSIS
grid-mapfile-add-entry [-help] [-usage] [-version] [-versions] grid-mapfile-add-entry {-dn DISTINGUISHED-NAME} {-ln LOCAL-NAME...} [[-d] | [-dryrun]] [[-mapfile MAPFILE] | [-f MAPFILE]] DESCRIPTION
The grid-mapfile-add-entry program adds a new mapping from an X.509 distinguished name to a local POSIX user name to a gridmap file. Gridmap files are used as a simple authorization method for services such as GRAM5 or GridFTP. The grid-mapfile-add-entry program verifies that the LOCAL-NAME is a valid user name on the system on which it was run, and that the mapping between DISTINGUISHED-NAME and LOCAL-NAME does not already exist in the gridmap file. By default, grid-mapfile-add-entry will modify the gridmap file named by the GRIDMAP environment variable if present, or the file /etc/grid-security/grid-mapfile if not. This can be changed by the use of the -mapfile or -f command-line options. If the gridmap file does not exist, grid-mapfile-add-entry will create it. If it already exists, grid-mapfile-add-entry will save the current contents of the file to a new file with the string .old appended to the file name. The full set of command-line options to grid-mapfile-add-entry are: -help, -usage Display the command-line options to grid-mapfile-add-entry. -version, -versions Display the version number of the grid-mapfile-add-entry command. The second form includes more details. -dn DISTINGUISHED-NAME The X.509 distinguished name to add a mapping for. The name should be in OpenSSL's oneline format. -ln LOCAL-NAME... The POSIX user name to map the distinguished name to. This name must be a valid username. Add multiple LOCAL-NAME strings after the -ln command-line option. If any of the local names are invalid, no changes will be made to the gridmap file. Note that if multiple occurances of the -ln command-line option are present, only the the last one will be added. -d, -dryrun Verify local names and display diagnostics about what would be added to the gridmap file, but don't actually modify the file. -mapfile MAPFILE, -f MAPFILE Modify the gridmap file named by MAPFILE instead of the default. EXAMPLES
Add a mapping between the current user's certificate to the current user id to a gridmap file in $HOME/.gridmap: % grid-mapfile-add-entry -f $HOME/.gridmap -dn "`grid-cert-info -subject`" -ln "`id -un`" Modifying /home/juser/.gridmap ... /home/juser/.gridmap does not exist... Attempting to create /home/juser/.gridmap New entry: "/DC=org/DC=example/DC=grid/CN=Joe User" juser (1) entry added Add a mapping between the a distinguished name and multiple local names: % grid-mapfile-add-entry -dn "/DC=org/DC=example/DC=grid/CN=Joe User" juser" local1 local2 Modifying /home/juser/.gridmap ... /home/juser/.gridmap does not exist... Attempting to create /home/juser/.gridmap New entry: "/DC=org/DC=example/DC=grid/CN=Joe User" local1,local2 (1) entry added ENVIRONMENT VARIABLES
The following environment variables affect the execution of grid-mapfile-add-entry: GRIDMAP Path to the default gridmap to modify. FILES
The following files affect the execution of grid-mapfile-add-entry: /etc/grid-security/grid-mapfile Path to the default gridmap to modify if GRIDMAP environment variable is not set. SEE ALSO
grid-mapfile-check-consistency(8), grid-mapfile-delete-entry(8) AUTHOR
University of Chicago Globus Toolkit 5.0.1 03/19/2010 GRID-MAPFILE-ADD-(8)
All times are GMT -4. The time now is 03:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy