Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I would like to create let say 100 folders inside every folders there has to be a text file plus 1 more folder and that folder has to have a spicific
name as well . I would like to do this through a list in a text file so piping would be in folded.
Is this possible or do I have to write a bash file for all of this.
There is probably a convoluted regexp for this, but the script method is best, yes.
You'd step through the list, create the directory, cd into it, create the subdirectory and text file, cd up, go to next line on the list.
This sounds like a homework assignment. It's your responsibility to do your homework.
What you want to do is possible using shell scripting. Two good resources to read to help you complete your assignment are: The Absolute Bash-scripting Guide and the Bash Guide for Beginners. Both can be found on the internet.
Maybe something like:
for i in < list.txt
Using redirect to input the names from the list of names to use (one name per line in the list). You should realize that this will work in your home directory when logged in as user. To create the directories elswhere, the script will have to run with root authority.
This would work as the outer loop to create the topmost directory, then nest an inner loop to create the inner folder and text file.
Last edited by bigrigdriver; 02-20-2008 at 05:00 AM.
Responses to posts often reflect the experience level of the person making the suggestion. Case in point: my contribution reflects beginner level scripting skills; Quigi's response reflects a more advanced skill level.
But both illustrate a truism in GNU/Linux: there is more that one way to get the job done.
Thanks, Quigi. My knowledge has increased thanks to your suggestion.
Or, if there is any truth in a favorite fantasy of mine: I'm really a top-notch script writer, but I tailored my response to my perceived skill level of the person who posted the problem.
Hmmm. Is he, or isn't he.
Last edited by bigrigdriver; 02-20-2008 at 03:45 PM.