Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Checking if multiple directories exist Post 302676289 by Corona688 on Tuesday 24th of July 2012 10:58:34 AM
Old 07-24-2012
Do you even need an array? Or a loop? mkdir can be fed more than one thing at a time, can be told to skip dirs that already exist with -p, and the shell automatically splits on spaces without the help of an array. So, you can do this all in one op without arrays.

Code:
DIRS="a b c"

if ! mkdir -v -p $DIRS
then
        echo "Problem creating $DIRS"
        exit 1
fi

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

moving directories to new directories on multiple servers

Hi - I am new to unix scripts...I need to move several directories on multiple servers to new directories. (0 Replies)
Discussion started by: mackdaddy07
0 Replies

2. Shell Programming and Scripting

checking textfile exists or not in all directories

Hai All, please help me in solving this assignment!!! i need a unix script that has to check the text file exists or not in all directories and sub directories if textfile exists display the directory path else display does not exists!! example: kamal.txt that i want to search if the... (5 Replies)
Discussion started by: G.K.K
5 Replies

3. Shell Programming and Scripting

checking existance of files and directories

I have a list of files and their directories, starting from a particular location. e.g. temp/new/a.c temp/new/b.c temp/old/a.c temp/old/older/b.c etc. Now I want to check the existence of all these files in the respective directories . I am trying something like cat "fileList" |... (4 Replies)
Discussion started by: herojeett
4 Replies

4. Shell Programming and Scripting

File exist checking error

Hi all, I have following code: export USERID=user export BATCHHOSTIP=190.113.3.324 remotePath=/home/user fileName=redbook.txt EXIST=`ssh $USERID@$BATCHHOSTIP 'if ; then echo 0; else echo 1 ; fi'` echo $EXIST II run the code from other server. The redbook.txt file is exist in... (1 Reply)
Discussion started by: suigion
1 Replies

5. Shell Programming and Scripting

check if multiple directories exist else create missing directories

Hi , I 'm trying to check if multiple directories exist on a server, if not create the missing ones and print " creating missing directory. how to write this in a simple script, I have made my code complex if ; then taskStatus="Schema extract directory exists, checking if SQL,Count and... (7 Replies)
Discussion started by: ramky79
7 Replies

6. UNIX for Dummies Questions & Answers

Deleting multiple directories inside multiple directories

Hi, Very unfamiliar with unix/linux stuff. Our admin is on vacation so, need help very quickly. I have directories (eg 40001, 40002, etc) that each have one subdirectory (01). Each subdir 01 has multiple subdirs (001, 002, 003, etc). They are same in each dir. I need to keep the top and... (7 Replies)
Discussion started by: kkouraus1
7 Replies

7. Shell Programming and Scripting

Checking FTP server file exist or not

I am trying to delete old file in ftp server, after transferring new file successfully . but here i am checking both the file available or not using ls command. if both the file available means i need to get file_new and file_old file size as greater than zero. but i am getting only for... (3 Replies)
Discussion started by: elango963
3 Replies

8. Shell Programming and Scripting

File exist for multiple files

Hi, I am unable to achieve the file exist conditions if there are multiple files same similar name for e.g. in a $Direct i am having files like aus.txt aus.txt_pr aus.txt_2012 i need to put a file exist condition like which is not working then echo "File present" but the... (9 Replies)
Discussion started by: rohit_shinez
9 Replies

9. Shell Programming and Scripting

Checking of file exist in different folder

Hi All, Seeking for your assistance to compare if the file in working directory is found on the DIR2 directory and if not found move the file in DIR2. ex. WORKING_DIR=/home/dir1/ file1.txt DIR2=/home/admin/users file1.txt what i did was found_nonempty='' for file in... (4 Replies)
Discussion started by: znesotomayor
4 Replies

10. Shell Programming and Scripting

Checking File record equal to multiple of 70 or nearest number to multiple of 70

Hello, I have a file with below content - Example 3 6 69 139 210 345 395 418 490 492 I would like the result as - Multiple of 70 or nearest number in the file less than the multiple of 70 69 139 (5 Replies)
Discussion started by: Mannu2525
5 Replies
mdassembler(1)						      General Commands Manual						    mdassembler(1)

NAME
mdassembler - Compile documentation for use in monodoc browser SYNOPSIS
mdassembler OPTIONS* DIRS+ DESCRIPTION
mdassembler has been obsoleted by mdoc(1). See the mdoc-assemble(1) man page. mdassembler is a program that creates .tree and .zip files for use in the monodoc documentation browser. The .tree and .zip files are copied into monodoc's sources directory, and reside with a .source file which is used by monodoc to specify where the documentation should be displayed. The .source file's /monodoc/source/@basefile attribute specifies the filename prefix for the documentation files. This must be the same prefix as used with the --out parameter. OPTIONS
--ecma The documentation found within DIRS is in the Mono ECMA documentation format. See the Mono ECMA Documentation Format section below. --ecmaspec The documentation found within DIRS is in the ECMA Specification documentation format. See the Mono ECMA Specification Documenta- tion Format section below. --error The documentation found within DIRS is in "error" format. See the Error Documentation Format section below. --help Show program argument information. --man The documentation found within DIRS is in man page format. See the Man Page Documentation Format section below. -o, --out PREFIX Specify the output file prefix. mdassembler creates the files PREFIX.zip and PREFIX.tree . --simple The documentation found within DIRS is in "simple" format. See the Simple Documentation Format section below. --xhtml, --hb The documentation found within DIRS is in XHTML format. See the XHTML Documentation Format section below. FORMATS
The following documentation formats are supported: Mono ECMA Documentation Format An XML documentation format with one file per type. See the mdoc(5) man page for more information. Mono ECMA Specification Documentation Format This is not the format you're looking for. This is the format used to represent the ECMA-334 (C#) standard within monodoc. It is not used to display class library documentation; for class library documentation, use the --ecma format. Error Documentation Format Used to present detailed error messages, and is used in monodoc's "C# Compiler Error Reference" tree. DIRS is not a directory, but is instead a configuration file, containing the XML: <ErrorProviderConfig> <FilesPath>../../mcs/errors</FilesPath> <Match>cs????*.cs</Match> <ErrorNumSubstringStart>2</ErrorNumSubstringStart> <ErrorNumSubstringLength>4</ErrorNumSubstringLength> <FriendlyFormatString>CS{0:0###}</FriendlyFormatString> </ErrorProviderConfig> /ErrorProviderConfig/FilesPath specifies where to look for files, /ErrorProviderConfig/Match specifies the filename pattern to look for within /ErrorProviderConfig/FilesPath, /ErrorProviderConfig/ErrorNumSubstringStart and /ErrorProviderConfig/ErrorNumSubstringLength control which portion of the filename is used as the error number, and /ErrorProviderConfig/FriendlyFormatString controls how the formatting/dis- play of the node in the monodoc tree. For each file found, it is converted to HTML with C# syntax coloring applied. Simple Documentation Format Converts text files into HTML by translating each newline into an HTML <br> element. Man Page Documentation Format Converts man pages into HTML for display. XHTML Documentation Format Copies the XHTML file as-is. EXAMPLES
To install your documenation for use with monodoc: Create a PREFIX.source file with the contents: <?xml version="1.0"?> <monodoc> <source provider="FORMAT" basefile="PREFIX" path="PATH"/> </monodoc> where FORMAT is the documentation format contained within the PREFIX.tree file, e.g. ecma, or simple. PREFIX is the basename of the .tree and .zip files that mdassembler creates. PATH is the "path" in the monodoc tree that should contain the documentation. See the @prefix@/lib/monodoc/monodoc.xml file for a list of PATH values (the //node/@name values). See also: http://www.mono-project.com/Generating_Documentation Create your documentation See also the monodocer(1) man page, e.g. monodocer -assembly:foo.dll -path:foo/en Assemble the documentation mdassembler --ecma foo/en PREFIX Make sure that you use the same PREFIX here as you did above. Install the documentation by using the command cp PREFIX.source PREFIX.tree PREFIX.zip `pkg-config monodoc --variable=sourcesdir` (Note the backticks used in the pkg-config command!) This copies the .source , .tree , and .zip files into the monodoc sources directory, which will allow monodoc to display the documentation. SEE ALSO
mdcs2ecma(1), mdnormalizer(1), mdoc(1), mdoc-assemble(1), mdvalidator(1), monodocer(1), monodocs2html(1) MAILING LISTS
Visit http://lists.ximian.com/mailman/listinfo/mono-docs-list for details. WEB SITE
See also: http://www.mono-project.com and http://www.mono-project.com/Assembler mdassembler(1)
All times are GMT -4. The time now is 02:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy