Jump to content

For loop for creating folders from file

- - - - -

  • Please log in to reply
3 replies to this topic

#1
Kintamasis

Kintamasis

    Newbie

  • Members
  • Pip
  • 7 posts
Hello, I'm new in bash scripting and i need some help with for loop script. I have file name - YER and in this file are 4 words as,sd,df,fg . I need to create
a for loop that take information from YER file and create 4 folders(as,sd,df,fg). can some one help me ?

#2
Kintamasis

Kintamasis

    Newbie

  • Members
  • Pip
  • 7 posts
no one knows ?

#3
xtatics

xtatics

    Newbie

  • Members
  • Pip
  • 1 posts
Different ways you can do it.

for folder in $(cat YER) ; do mkdir $folder ; done

#4
DarkLordofthePenguins

DarkLordofthePenguins

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 409 posts
I suggest using sed or awk if you want to extract parts of a text file.

Amazon.com: sed & awk (2nd Edition) (9781565922259): Dale Dougherty, Arnold Robbins: Books
Programming is a journey, not a destination.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users