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

sequelize.js - Sequelize group by with association includes id -

android - Robolectric "INTERNET permission is required" -

java - Android raising EPERM (Operation not permitted) when attempting to send UDP packet after network connection -