Welcome to the new Linux Foundation Forum!
How to create folder name same as text file
1. I need guide on how to create a folder name from the text file with .txt format.
2. First, I call the function of reading the directory.
3. Then, I dont know how to do.
4. Finally, I close the directory
This is my source code in perl
## read text.txt file ##
open F, "from/$directory/text.txt";
read F, $buf, 9999;
close F;[/size]
This source code is used to print the folder with date format like "ddmm" d stands for day and m stands for month
if ($command =~ s/-O "(.*)"/-O "$websites\/$month\/$file"/)
Instead, I want to have the name from text.txt to be folder name
0
Comments
You have a file, let's say test.txt which has many lines, each line is the name of a folder to be created. Then you would do something like:
to create the folders? Is that what you want?
1. For ur info, I only need to create one folder since I only gt one line there too.
2. so is it, cat test.txt | mkdir {}
And if you want to make it a script, then it should be as:
It could still be improved a lot but at least will give you an idea of where to start.
And, talking about where to start, it would be a good idea to check the following link out.
Advance Bash Scripting Guide
This works if there is just one line to create one directory
If you have multiple lines and want to create multiple directories: