Sponsored Content
Full Discussion: Making a Directory
Top Forums Shell Programming and Scripting Making a Directory Post 67273 by muthukumar on Tuesday 22nd of March 2005 06:15:49 AM
Old 03-22-2005
Try with this script as,

Code:
while read line; do
  echo $line | grep -q '^Directory'
  if [[ $? -eq 0 ]]
  then
    mkdir $(echo $line | cut -d ':' -f2)
  fi
done < directory_file

It will work.

HTH.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Making the right choise

I need help on making right decision on witch unix based OS to choose from. What woud be the great for a beginner? :confused: (8 Replies)
Discussion started by: thunderfastfox
8 Replies

2. Shell Programming and Scripting

making script

hello experts cany any one help me i want to make one script which can rlogin to another machine . but it should not ask me username/password from me of another machine it should take the username and password from the script only. please help me out. regards, shary (2 Replies)
Discussion started by: shary
2 Replies

3. Shell Programming and Scripting

making sure my string is [a-z] only

Hi there I am trying to figure out how I can validate my string to ensure that it is consists of only lower case alpha chrataters but for some reason whatever I do, it seems to come back with 'true' I have tried if " ]] ; then echo "yes its fine" else echo... (21 Replies)
Discussion started by: hcclnoodles
21 Replies

4. UNIX for Dummies Questions & Answers

Help making a library

I understand how to use vi and emacs but I have a project which entails building a library application like a phone directory or listing of dvd's. I am lost on where to start. any help would be appreciated. (3 Replies)
Discussion started by: gustave
3 Replies

5. UNIX for Advanced & Expert Users

Regarding help for making own OS

Dear Fellow, I want to make my own OS, Kindly suggest from where i should start. please help me out. (2 Replies)
Discussion started by: zaigham_tt
2 Replies

6. Shell Programming and Scripting

making find/sed to include directory names with spaces

how can i make find/sed to include directory names with spaces the command is like this for i in `find wp-content/themes -type f -print0 | xargs -0 grep -l -iE 'e'`;do sed -i -e 's/word1/word2/gI' "$i";done but it skips one directory names with spaces sed: can't read ./Nova: No such... (5 Replies)
Discussion started by: vanessafan99
5 Replies

7. Shell Programming and Scripting

I could use some help with making a script

I run a small instrument lab. We track our user's time on the instruments with a very manual process of 'last wtmp.1' then cut/paste data into spreadsheets. My boss makes the initial spreadsheets then I convert and format them for uploading into our billing software (COReS). Cores is looking for a... (8 Replies)
Discussion started by: jpontius
8 Replies

8. AIX

Making Tar of directory and tar file is going to be placed

Quick question, is it possible to make a Tar of completely directory and placing the tar file in it (will this cause even the tar file to tarred ?) sample: /opt/freeware/bin/tar -cvf - /oracle | gzip > /oracle/backup.tgz will the tar file backup.tgz also include backup.tgz ? i tried... (5 Replies)
Discussion started by: filosophizer
5 Replies

9. UNIX for Beginners Questions & Answers

Help me making this script

This script is executed whenever a new vehicle is added to the cycle-motor park of campus. The script asks for the following information about the car and adds a new line to the vehicle file.txt: name (name of an animal, unique identifier), color, mark, model, type (e.g., electrical, manual),... (2 Replies)
Discussion started by: andre2222
2 Replies
DIR(3)									 1								    DIR(3)

dir - Return an instance of the Directory class

SYNOPSIS
Directory dir (string $directory, [resource $context]) DESCRIPTION
A pseudo-object oriented mechanism for reading a directory. The given $directory is opened. PARAMETERS
o $directory - Directory to open o $context - Note Context support was added with PHP 5.0.0. For a description of contexts, refer to "Streams". RETURN VALUES
Returns an instance of Directory, or NULL with wrong parameters, or FALSE in case of another error. EXAMPLES
Example #1 dir(3) example Please note the fashion in which Directory.read(3)'s return value is checked in the example below. We are explicitly testing whether the return value is identical to (equal to and of the same type as - see Comparison Operators for more information) FALSE since otherwise, any directory entry whose name evaluates to FALSE will stop the loop. <?php $d = dir("/etc/php5"); echo "Handle: " . $d->handle . " "; echo "Path: " . $d->path . " "; while (false !== ($entry = $d->read())) { echo $entry." "; } $d->close(); ?> The above example will output something similar to: Handle: Resource id #2 Path: /etc/php5 apache cgi cli NOTES
Note The order in which directory entries are returned by the read method is system-dependent. PHP Documentation Group DIR(3)
All times are GMT -4. The time now is 01:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy