Sponsored Content
Top Forums Shell Programming and Scripting Automating creation of directories Post 302597505 by sharone on Friday 10th of February 2012 01:30:21 PM
Old 02-10-2012
Automating creation of directories

I have a top-level directory called work and I would like to create subdirectories work1 work2... under this directory. Also I would like to create subdirectory under work1 -- test, work2 -- test etc., Can I automate this using a command-line script?

Code:
work 
|_work 1
    |_test
|_work 2
    |_test 
|_work 3 
    |_test

 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Automating creation of sub-domains???

Edit, Sorry realised that muxtape.com is probably not creating a sub-domain for every accout but more than likely using a wildcard in the apache config and then using php/asp/java or similar to look at the url and point it in the right direction. So youraccount.muxtape.com maps to... (0 Replies)
Discussion started by: elduderino
0 Replies

2. Shell Programming and Scripting

Script for parsing directories one level and finding directories older than n days

Hello all, Here's the deal...I have one directory with many subdirs and files. What I want to find out is who is keeping old files and directories...say files and dirs that they didn't use since a number of n days, only one level under the initial dir. Output to a file. A script for... (5 Replies)
Discussion started by: ejianu
5 Replies

3. Shell Programming and Scripting

Creation of multiple directories

I have a folder structure like the below /test/test1/test2/app /test/test3/app /test/test4/test5/app .. I need to create a new folder under "app" in all the above listed directory structure at one shot by the name "subapp" . How can we acheive this using a script . New to unix... (4 Replies)
Discussion started by: rajeshnatarajan
4 Replies

4. UNIX for Dummies Questions & Answers

List directories with given string, sort by creation date

It is for HP-Unix B.11.31. Requirement: 1. List the directories, which directories name has given particular string. Example: Directories with name "Build" 2. On the output of 1. list the directories by creation date as sort order. I tried with; find . -type d -name "Build*" ... (3 Replies)
Discussion started by: Siva SQL
3 Replies

5. HP-UX

Symbolic link creation between 2 directories on different machines

I am trying to link 2 directories using: ln -s /net/<hostname>/srcdir/ /net/<desthostname>/dstdir/ I get the following error: ln: /net/<desthostname>/dstdir: Function is not available What is it that i am trying to do wrongly in the above operation? Please use next time code tags (3 Replies)
Discussion started by: Amit Kulkarni
3 Replies

6. Shell Programming and Scripting

How to list all the files, directories and sub-directories in the current path except one directory?

Can anyone come up with a unix command that lists all the files, directories and sub-directories in the current directory except a folder called log.? Thank you in advance. (7 Replies)
Discussion started by: Manjunath B
7 Replies

7. UNIX for Dummies Questions & Answers

List the directories, having given pattern in the directories name, sorted by creation date

It is for HP-Unix B.11.31. Requirement: 1. List the directories, having given pattern in the directories name, sorted by creation date. Example: Directories with name "pkg32*" or "pkg33*" 2. On the output of 1. list the directories by creation date as sort order, with creation date... (2 Replies)
Discussion started by: Siva SQL
2 Replies

8. Shell Programming and Scripting

[Solved] Creation of directories

i am having trouble creating a directory with last months date as the folder name. what i am using is echo `date +%b%y` which gives Mar14 as the result but i want to get Feb14 as the result.:wall: (6 Replies)
Discussion started by: simkazw
6 Replies

9. Solaris

Giving read write permission to user for specific directories and sub directories.

I have searched this quite a long time but couldn't find the right method for me to use. I need to assign read write permission to the user for specific directories and it's sub directories and files. I do not want to use ACL. This is for Solaris. Please help. (1 Reply)
Discussion started by: blinkingdan
1 Replies
Catalyst::Helper(3pm)					User Contributed Perl Documentation				     Catalyst::Helper(3pm)

NAME
Catalyst::Helper - Bootstrap a Catalyst application SYNOPSIS
catalyst.pl <myappname> DESCRIPTION
This module is used by catalyst.pl to create a set of scripts for a new catalyst application. The scripts each contain documentation and will output help on how to use them if called incorrectly or in some cases, with no arguments. It also provides some useful methods for a Helper module to call when creating a component. See "METHODS". SCRIPTS
_create.pl Used to create new components for a catalyst application at the development stage. _server.pl The catalyst test server, starts an HTTPD which outputs debugging to the terminal. _test.pl A script for running tests from the command-line. _cgi.pl Run your application as a CGI. _fastcgi.pl Run the application as a fastcgi app. Either by hand, or call this from FastCgiServer in your http server config. HELPERS
The "_create.pl" script creates application components using Helper modules. The Catalyst team provides a good number of Helper modules for you to use. You can also add your own. Helpers are classes that provide two methods. * mk_compclass - creates the Component class * mk_comptest - creates the Component test So when you call "scripts/myapp_create.pl view MyView TT", create will try to execute Catalyst::Helper::View::TT->mk_compclass and Catalyst::Helper::View::TT->mk_comptest. See Catalyst::Helper::View::TT and Catalyst::Helper::Model::DBIC::Schema for examples. All helper classes should be under one of the following namespaces. Catalyst::Helper::Model:: Catalyst::Helper::View:: Catalyst::Helper::Controller:: COMMON HELPERS o Catalyst::Helper::Model::DBIC::Schema - DBIx::Class models o Catalyst::Helper::View::TT - Template Toolkit view o Catalyst::Helper::Model::LDAP o Catalyst::Helper::Model::Adaptor - wrap any class into a Catalyst model NOTE The helpers will read author name from /etc/passwd by default. To override, please export the AUTHOR variable. METHODS
mk_compclass This method in your Helper module is called with $helper which is a Catalyst::Helper object, and whichever other arguments the user added to the command-line. You can use the $helper to call methods described below. If the Helper module does not contain a "mk_compclass" method, it will fall back to calling "render_file", with an argument of "compclass". mk_comptest This method in your Helper module is called with $helper which is a Catalyst::Helper object, and whichever other arguments the user added to the command-line. You can use the $helper to call methods described below. If the Helper module does not contain a "mk_compclass" method, it will fall back to calling "render_file", with an argument of "comptest". mk_stuff This method is called if the user does not supply any of the usual component types "view", "controller", "model". It is passed the $helper object (an instance of Catalyst::Helper), and any other arguments the user typed. There is no fallback for this method. INTERNAL METHODS
These are the methods that the Helper classes can call on the <$helper> object passed to them. render_file ($file, $path, $vars, $perms) Render and create a file from a template in DATA using Template Toolkit. $file is the relevent chunk of the __DATA__ section, $path is the path to the file, $vars is the hashref as expected by Template Toolkit and $perms are desired permissions (or system defaults if not set). get_file ($class, $file) Fetch file contents from the DATA section. This is used internally by "render_file". $class is the name of the class to get the DATA section from. __PACKAGE__ or ( caller(0) )[0] might be sensible values for this. mk_app Create the main application skeleton. This is called by catalyst.pl. mk_component ($app) This method is called by create.pl to make new components for your application. mk_dir ($path) Surprisingly, this function makes a directory. mk_file ($file, $content) Writes content to a file. Called by "render_file". next_test ($test_name) Calculates the name of the next numbered test file and returns it. Don't give the number or the .t suffix for the test name. get_sharedir_file Method for getting a file out of share/ render_file_contents Process a Template::Toolkit template. render_sharedir_file Render a template/image file from our share directory NOTE
The helpers will read author name from /etc/passwd by default. To override, please export the AUTHOR variable. SEE ALSO
Catalyst::Manual, Catalyst::Test, Catalyst::Request, Catalyst::Response, Catalyst AUTHORS
Catalyst Contributors, see Catalyst.pm LICENSE
This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2012-05-19 Catalyst::Helper(3pm)
All times are GMT -4. The time now is 10:41 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy