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
DH_RUBY(1)																DH_RUBY(1)

NAME
dh_ruby - debhelper7 build system for Ruby software SYNOPSIS
dh_ruby [OPTIONS] DESCRIPTION
dh_ruby is a Debhelper 7 build system for Ruby software. It will automatically build and install files contained in Ruby packages, trying to work as close to Rubygems as possible but respecting Debian standards for Ruby packages. dh_ruby can automatically run your tests against all supported Ruby versions, see the "FILES" section below. See dh_ruby --help for details. OPTIONS
--clean, --configure, --build, --test, --install Commands called by debhelper at various steps of the build process. -h, --help Displays dh_ruby usage information. -v, --version Displays dh_ruby version information. --setuprb This option indicates that the build should use setup.rb rather than the usual gem-based build. To take effect, this option must come first ! ENVIRONMENT VARIABLES
DH_RUBY_IGNORE_TESTS This is a space-separated list of tests that dh_ruby will ignore during package build. The available test names are "require-rubygems" plus the names of all supported Ruby versions. At the time of writing, only "ruby1.8" and "ruby1.9.1" are supported. If set to "all", all tests will be ignored during the package build. DH_RUBY_USE_DH_AUTO_INSTALL_DESTDIR If this variable is defined (to anything), dh_ruby will respect the directory informed by dh_auto_install(1), usually debian/tmp. By default, gem2deb will install files to debian/package, where package is the first binary package listed in debian/control. This is useful for multi-binary source packages, where you will have all files installed to debian/tmp, and can them split the files into separate packages by using debian/package.install. DH_RUBY_GEMSPEC Determines which file contain the gem specification with package metadata. By default, dh_ruby will read metadata from a .gemspec file in the root of source package directory. You can use this variable to override that if want to provide custom metadata for the Debian package. In the case there are more than one .gemspec in the source package root, you will need to use DH_RUBY_GEMSPEC to instruct dh_ruby about which one to use. FILES
debian/ruby-test-files.yaml, debian/ruby-tests.rake, debian/ruby-tests.rb Theses files can be used to explicitly tell dh_ruby how to run the tests in your package. When running the tests, dh_ruby will automatically set RUBYLIB to include the appropriate directories where the package files were installed in your package to make sure the tests use them instead of the files in the source directory. Your package can only contain at most one of these files. debian/ruby-test-files.yaml must contain a YAML document with a list of test files to be run. If the package metadata contains an explicit list of test files, gem2deb(1) will automatically generate this file for you. Example from ruby-mime-types: --- - test/test_mime_type.rb - test/test_mime_types.rb debian/ruby-tests.rake can be used to run the tests with rake(1). If you use this file, your package must Build-Depend on the rake package. You can use anything you would use in a regular Rakefile, but you must define a default task. gem2deb includes utility test task that makes it easier for you by creating a default task automatically. Example: require 'gem2deb/rake/testtask' Gem2Deb:Rake::TestTask.new do |t| t.test_files = FileList['test/*_test.rb'] end If debian/ruby-tests.rb exists, it will be run with each supported Ruby version, and must finish with a exit status of 0, otherwise dh_ruby assumes the tests failed. A simple example: require 'test/unit' require 'mypackage' # if 'mypackage.rb' or 'mypackage.so' was not installed properly, this will fail class MyPackageTest < Test::Unit::TestCase def test_features assert_equal 4, MyPackage.sum(2,2) end end debian/require-rubygems.overrides Fine-tune the "require-rubygems" test. If the package has a very good reason to actually `require "rubygems"`, you can use this file as a whitelist of files allowed to have `require "rubygems"`. This file is expect to contain a YAML document with a list of files that must be ignored when checking for `require "rubygems"` lines. Example: --- - debian/ruby-foo/usr/lib/ruby/vendor_ruby/foo.rb - debian/ruby-foo/usr/lib/ruby/vendor_ruby/foo/rubygems.rg As you can see above, you have to list filenames based on their corresponding install locations in the package temporary install directory, i.e. `debian/${pkg}/..` SEE ALSO
gem2deb(1) COPYRIGHT AND AUTHORS
Copyright (c) 2011, Lucas Nussbaum <lucas@debian.org> This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. 2012-05-17 DH_RUBY(1)
All times are GMT -4. The time now is 08:57 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy