The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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
Protecting the directory tree rooneyl UNIX for Dummies Questions & Answers 2 02-17-2008 05:59 PM
directory tree ravi raj kumar Shell Programming and Scripting 3 01-24-2008 01:08 PM
Searching directory tree blane Shell Programming and Scripting 7 05-29-2007 07:30 PM
directory as tree anything2 High Level Programming 2 03-01-2007 09:38 AM
Directory tree search??? solvman High Level Programming 3 09-28-2001 01:27 PM

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-13-2007
wicked24 wicked24 is offline
Registered User
  
 

Join Date: Nov 2007
Posts: 2
setup directory tree

All,
I am new to Unix scripting ans was looking for some guidance.

I basically have to:
1. Check if a directory exists - if not create it
2. Check the permissions of the dir - if Wrong change
loop this.

Sort of creating a directory tree.

Thanks.

Last edited by wicked24; 11-13-2007 at 08:19 AM.. Reason: Hit enter key by mistake
  #2 (permalink)  
Old 11-13-2007
V3l0 V3l0 is offline
Registered User
  
 

Join Date: Nov 2007
Location: Belgium & France
Posts: 70
To make a directory tree, even if some don't exists, use :

Code:
mkdir -p toto/titi/tata/tutu
Use umask command to set default rights on creation.
Use chmod command to set rights after creation.

Good luck.
  #3 (permalink)  
Old 11-15-2007
wicked24 wicked24 is offline
Registered User
  
 

Join Date: Nov 2007
Posts: 2
Wink Maybe this will help

Ok – Here is what I need:
Below is the directory structure that I want to create and set permissions on.
Directory Permissions
/apps/ki01/logs/app_yyxzzz drwxr-xr-x
/apps/ki01/bin/app_yyxzzz drwxr-xr--
/apps/ki01/scripts/app_yyxzzz drwxr-xr--
/apps/ki01/src/app_yyxzzz drwxr-xr--
/apps/ki01/ssl/app_yyxzzz/ drwxr-x---
/apps/ki01/htdocs/IHS_yyxzzz/ drwxr-xr--
/apps/ki01/ssl/IHS_yyxzzz/ drwxr-x---
/export/home/trace/app_yyxzzz/ drwxr-xr-x

1st – I need to check if the directory already exists and also if it matches the permissions.
2nd – if not then create the directory and set correct permissions.
This is for all directories.
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:49 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