awk - Bash directories going in the wrong place -


i'm bash noob great! in advance!

what i'm trying take first column students.txt file in input folder , create directories them in output folder.

my problem when execute script 1 (the first $stuid) directory gets made inside output folder. rest goes main folder.

#!/bin/bash  filecontent=`awk '{print $1}' input/students.txt`     stuid in "${filecontent[*]}";  mkdir -p ./output/$stuid     done 

use while read loop extract first field each line , create directory:

while read -r stu_id junk;     mkdir -p ./output/"$stu_id" done < input/students.txt 

Comments

Popular posts from this blog

ios - Is 'init' forbidden as *part* of a variable name? -

angular - Angular2 Router: Cannot find primary outlet to load 'HomeComponent' -

qt - Microsoft FTP Service 451 The parameter is incorrect -