Script to cycle over two columns using entries from each as vars in same command
I'm trying to write a bash script that will cycle through column 1, use each entry as the first variable in a command, then use each entry in column 2 as the second variable in the same command. Not having much luck though...
I have a list of raw device bindings the way they should be bound on multiple boxes in a cluster. I want to use this list to create the raw devices on each box, without having to manually type them all in on each box (there will be well over 100 devices).
Here's what the top part of the list looks like (truncated):
Here's what I started with, but it fails because I'm trying to loop over each entry twice I guess. It just gives me the usage message for the raw command, which is formatted correctly, so it's not getting the info it needs out of the variables I guess:
for rawdev in "$(cat raw.txt | cut -d: -f1)"; do
for emcdev in "$(cat raw.txt | cut -d: -f2)"; do
raw /dev/raw/$rawdev /dev/$emcdev;
How do I get just column 1 entries into one variable in the command, and just column 2 entries into the other variable, and keep them sorted the way they are now?
Thanks for any help or advice.