sunil9009 has asked for the wisdom of the Perl Monks concerning the following question:
Situation: I have a tool/command (tool.pl) that accepts max 5 hostnames as @ARGV. I have a file that contains hostnames, each host in a newline. There are 12 hosts in the file. How can I split the hostnames in the file to pass them to tool.pl with 5 hostnames as arguments
host1 host2 host3 host4 host5 host6 host7 host8 host9 host10 host11 host12
During the first iteration expected
tool.pl host1 host2 host3 host4 host5Second iteration
tool.pl host6 host7 host8 host9 host10Third iteration
tool.pl host11 host12Thanks for the help in advance
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: split on every n lines
by choroba (Cardinal) on Apr 10, 2014 at 07:56 UTC | |
|
Re: split on every n lines
by kcott (Archbishop) on Apr 10, 2014 at 06:14 UTC | |
|
Re: split on every n lines
by AnomalousMonk (Archbishop) on Apr 10, 2014 at 05:58 UTC | |
|
Re: split on every n lines
by monsoon (Pilgrim) on Apr 10, 2014 at 06:00 UTC | |
|
Re: split on every n lines
by hdb (Monsignor) on Apr 10, 2014 at 06:39 UTC | |
|
Re: split on every n lines
by johngg (Canon) on Apr 10, 2014 at 10:24 UTC | |
|
Re: split on every n lines
by LanX (Saint) on Apr 10, 2014 at 11:33 UTC | |
|
Re: split on every n lines (tamwtdi)
by oiskuu (Hermit) on Apr 10, 2014 at 18:11 UTC | |
|
Re: split on every n lines
by sunil9009 (Acolyte) on Apr 11, 2014 at 05:41 UTC | |
|
Re: split on every n lines
by sunil9009 (Acolyte) on Apr 10, 2014 at 19:52 UTC | |
by hbm (Hermit) on Apr 11, 2014 at 01:52 UTC | |
by monsoon (Pilgrim) on Apr 10, 2014 at 20:48 UTC |