Skip to main content
3 of 3
added 311 characters in body
KB73
  • 1
  • 3

Try this:

arr=($(cut -d ' ' -f1,2 < $*)) mkdir $(for ((i=0;i<${#arr[@]};i=i+2)); do echo ${arr[$i+1]:0:4}${arr[$i]:0:2}; done) 

The first line will create an array with only the first 2 fields from the input. Each element in the array will have two fields (first, last). The second line will go through each element in the array and substitute each field according the requirement and make a new directory out of each new formed entry.

KB73
  • 1
  • 3