Using xargs to process file from list?
I've got a file full of domains in the format of
domain.com domain2.com domain3.com I need to run the following command for each line mkzone <domain> <ip> Is there any way I could use xargs to execute mkzone <line1 from txtfile> 192.168.0.2 mkzone <line2 from txtfile> 192.168.0.2 for each line in my text file? I figure I could it with xargs, maybe a for in file loop in bash. I'm not sure for either way. Any ideas? |
With a POSIX compliant shell (like ksh or bash):
Code:
for domain in $(<file_full_of_domains) |
Code:
cat test | xargs -I {} mkzone "{}" 192.168.0.2 |
All times are GMT -5. The time now is 08:26 AM. |