Bash Redirecting Input from Multiple Files

Read data from two files. In this case one file with ctid’s (openvz ve numbers). And one file with ip addresses.

#!/bin/bash

exec 7<$1 8<$2

    while read f1 <&7 && read f2 <&8
    do
      vzctl set $f1 --ipadd $f2 --save
    done

http://www.linuxjournal.com/content/bash-redirecting-input-multiple-files

Leave a Reply

Your email address will not be published. Required fields are marked *