Answers for "bash make folders according to a list"

0

bash make folders according to a list

IFS=','read -ra tokens <<< "$contents"  ## your list

for x in "${tokens[@]}"
do
    mkdir $x
    cd $x
    # so something tough $x.txt 
    cd ..

done
Posted by: Guest on January-30-2021
0

bash make folders according to a list

myArray=(A C G U)

triplet_len=${#myArray[@]}

j=0
while [ $j -lt $triplet_len ]
  do
    mkdir ./${triplet[j]}  #create directiroy with name of triplet
    cd ./${triplet[j]}
        # do something
    cd ..
 ((j++))
 done
Posted by: Guest on January-30-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language