The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Script to remove all empty files within the directory structure? cat123 Shell Programming and Scripting 5 06-05-2008 10:01 AM
Need help in Directory Structure murtaza Shell Programming and Scripting 5 03-29-2007 12:14 PM
make directory script malaysoul Shell Programming and Scripting 0 02-11-2007 11:10 AM
MV files from one directory structure(multiple level) to other directory structure srmadab UNIX for Advanced & Expert Users 4 09-13-2006 05:01 PM
Copying a Directory Structure to a new structure jhansrod UNIX for Dummies Questions & Answers 8 07-27-2005 07:24 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-07-2005
kamur kamur is offline
Registered User
  
 

Join Date: Nov 2005
Location: Denver
Posts: 2
Need script to make big directory structure

Hi,

I'm a novice and I'd like to make a directory structure with a hundred or so folders. I've tried mkdir /foo/foo1/etc...

mkdir /foo/foo2/etc
mkdir /foo/foo3/etc
mkdir /foo/foo4/etc

...but it appends '@' to each folder name and then fails on the subdirectories. Is it better to use a looping command to repeat mkdir and then loop thru a list of folder names in an external txt file for example?

Thanks, Keith.
  #2 (permalink)  
Old 11-07-2005
vgersh99's Avatar
vgersh99 vgersh99 is online now Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,131
try using 'mkdir -p ....'

quoting 'man mkdir':

Code:
     -p        With this option, mkdir  creates dir  by  creating
               all the non-existing parent directories first. The
               mode given to intermediate directories will be the
               difference  between  777  and  the bits set in the
               file mode creation mask. The difference,  however,
               must be at least 300 (write and execute permission
               for the user).

  #3 (permalink)  
Old 11-07-2005
kamur kamur is offline
Registered User
  
 

Join Date: Nov 2005
Location: Denver
Posts: 2
Thanks. That helped.

Thanks. That helped.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:45 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0