Passing multiple sets of arguments to a command
- by Alec
instances contains several whitespace separated strings, as does snapshots.
I want to run the command below, with each instance-snapshot pair.
ec2-attach-volume --instance $instances --device /dev/sdf $snapshots
For example, if instances contains A B C, and snapshots contains 1 2 3, I want the command to be called like so:
ec2-attach-volume -C cert.pem -K pk.pem --instance A --device /dev/sdf 1
ec2-attach-volume -C cert.pem -K pk.pem --instance B --device /dev/sdf 2
ec2-attach-volume -C cert.pem -K pk.pem --instance C --device /dev/sdf 3
I can do either one or the other with xargs -n 1, but how do I do both?