Skip to content
Advertisement

Bash Create Directories/Subdirectories Using Two Lists

I would like to create a number of directories, each with a number of subdirectories based on two lists using Bash. Currently, the below code achieves this result:

JavaScript

Yields

JavaScript

Question: Is there a cleaner (non-single-line) way to achieve the same result, perhaps storing the two lists as arrays or variables and using loops?

Advertisement

Answer

Use nested loops:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement