zpesk
zpesk

Reputation: 4353

Create new directory using contents of file

In bash I have a file called temporary.txt that contains one line of text. I want to use the contents of this line of text to create a new directory? How can i do this?

Upvotes: 1

Views: 673

Answers (2)

Vijay
Vijay

Reputation: 67221

Try this which is less complex than the accepted answer.

mkdir `cat temp`

For each and every word in your text file this creates a directory.

Upvotes: 1

Devon_C_Miller
Devon_C_Miller

Reputation: 16518

Try this:

mkdir "$(< temporary.txt)"

Upvotes: 5

Related Questions