in reply to Create zip files for each sub-directory under a main directory
G'day mrd1019,
Welcome to the Monastery.
"I’m thinking a foreach loop would work?"
Did you try that? If so, what difficulties did you encounter? If not, then give it a go and, if you encounter difficulties, tell us what they are.
"I’m not 100% sure how to go about getting to my end goal."
Again, without knowing what your problem is, it's not really possible to offer a solution.
I'll take a complete guess that you don't know how to generate the "apxxxx.zip" filenames. For this, you'll probably want the sprintf function. Here's an example with printf (which uses the same formats as sprintf):
$ perl -e 'printf "ap%04d.zip\n", $_ for (0, 1, 234, 1335)' ap0000.zip ap0001.zip ap0234.zip ap1335.zip
— Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Create zip files for each sub-directory under a main directory
by mrd1019 (Novice) on Nov 29, 2016 at 19:40 UTC | |
by hippo (Archbishop) on Nov 29, 2016 at 21:24 UTC | |
by kcott (Archbishop) on Nov 29, 2016 at 21:52 UTC | |
by stevieb (Canon) on Nov 29, 2016 at 22:09 UTC |