parameters in loop 
Author Message
 parameters in loop


   ><!doctype html public "-//w3c//dtd html 4.0 transitional//en">
   ><html>
   >&nbsp;hello!
<BLINK><font size=7 color=plaid> Please don't post in HTML! <font size=1>
I have a file like that:
    /toto 170 lvol1 vg01
    /titi    250 lvol8 vg10
    and so on
    I want to use theses lines as parameters to create
File System
automatically in a commands like lvcreate and newfs that will read
each line and
extract $1,$2 and so on

I don't think you need awk for this, just a simple shell script, like:
#!/bin/sh
while read dir size lvol vg
do
   commands to create a filesystem using $dir $size $lvol $vg
done < file

Net-Tamer V 1.08X - Test Drive



Fri, 11 Apr 2003 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. for-loop parameters

2. vars() without parameter goes into infinite loop

3. subroutine calls with loop index parameters

4. Passing a parameter Rexx to JCL and return a parameter to JCL

5. VHDL to Verilog - parameter which is log2 of another parameter

6. Ada 0y wish list: parameters of package parameters

7. Parameter MyVar = ## Vs Parameter ( MyVar = ## )

8. parameter syntax for array parameter

9. language rules question: using a (passed in) parameter to define a parameter

10. break one loop and skip one iteration of outer loop

11. 2 files: a loop within a loop??

12. Problem with loop inside other loop

 

 
Powered by phpBB® Forum Software