I'm currently using the following two scripts to create multiple directories and subdirectories. The first script creates '/Dir1/Dir2' and the second script then adds multiple subdirectories to 'Dir2'.
#!/bin/bash # Creates directories and subdirectories from text file cat *.txt | xargs -L 1 mkdir -p #!/bin/bash # Lists all directories in current working directory and create subdirectories LIST=`ls -D` for i in $LIST; do mkdir -p $i"/Dir3/Dir4/" done
I've combined the two script but the subdirectories Dir3 and Dir4 are created in Dir1 and not Dir2 as intended. With my very limited knowledge of scripting I'm unable to successfully search for the answer and therefore turn to you guys for assistance.