Sponsored Content
Top Forums Shell Programming and Scripting To check whether a directory is exist and if it is not, create it Post 302238534 by Lakris on Saturday 20th of September 2008 02:23:03 PM
Old 09-20-2008
Hi!
This may depend on other stuff of course... but generally if You want a directory, just create it, and if You don't want the error message use the -p option.

Otherwise, Gee-Money has the correct method.

/Lakris
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to check if directory/file exist using c/c++

Hi there,, how to check if directory/file exist using c/c++ under unix/linux? I can use access() under Window MFC. Thanks. Steven (1 Reply)
Discussion started by: steven88
1 Replies

2. Programming

how to check if directory/file exist using c/c++

Hi there, how to check if directory/file exist using c/c++ under linux/unix. Thanks. Steven (2 Replies)
Discussion started by: steven88
2 Replies

3. Shell Programming and Scripting

Check if certain files exist in a directory, if not add name to a textfile

We recieve some logs on our windows box via FTP on a daily basis, in the same directory. I would like to check for missing logs files and add their name to a text file. Something like... Check if C:\logs\file1_currentdate exists (if not, add file1_currentdate to... (1 Reply)
Discussion started by: SunnyK
1 Replies

4. Shell Programming and Scripting

How to check directory exist on servers

There are many servers and their directory structer should be exactly the same. To check the directory path for all servers, I wrote a script. #! /bin/ksh ARRAY_DIRECTORIES="/c/dev/custom/bin" ARRAY_DIRECTORIES="/c/dev/db/custom/src" ARRAY_ENV="remoteName200" ARRAY_ENV="remoteName201"... (2 Replies)
Discussion started by: weonpc
2 Replies

5. Shell Programming and Scripting

If file not exist create a new one

i want a script to check whether the file name exits or not if not it has to create a new one (3 Replies)
Discussion started by: din_annauniv
3 Replies

6. Shell Programming and Scripting

check the directory exist

I have the below script to check whether directory is exist or not , now I sure the directory /abc NOT exist , but when run the script , it still pop the result is "the directory exist" , could suggest what is wrong ? thx ll -d /abc > /dev/null 2>&1 if then echo "the directory exist !!" ... (7 Replies)
Discussion started by: ust
7 Replies

7. 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

8. Shell Programming and Scripting

how to check file exist in a directory or not

HI folks, can any one tell me how to check whether the file is existed in a directory or not . let me tell you my requirement : if the file is existed i should display a one message or else i have to send a mail .. i have the mail logic .. but I'm failed to check file existence .. please... (5 Replies)
Discussion started by: sravan008
5 Replies

9. Shell Programming and Scripting

how to check if a directory exists or not.if not need to create it

Hi, I am using solaris 10 OS and bash shell.just checking for small code snippet which follows below. /export/home/vomappservers/spa/common/5.0 /export/home/vomappservers/spa/common/scripts /export/home/vomappservers/spa/tools /export/home/vomappservers/spa/scm5.0/SCCS... (5 Replies)
Discussion started by: muraliinfy04
5 Replies

10. Shell Programming and Scripting

Bash to check directory and create missing folder from file

In the below bash I am trying to ensure that all folders (represented by $folders) in a given directory are created. In the file f1 the trimmed folder will be there somewhere (will be multiple trimmed folders). When that trimmed folder is found (represented by $S5) the the contents of $2 printed... (19 Replies)
Discussion started by: cmccabe
19 Replies
mkmsgs(1)                                                          User Commands                                                         mkmsgs(1)

NAME
mkmsgs - create message files for use by gettxt SYNOPSIS
mkmsgs [-o] [-i locale] inputstrings msgfile DESCRIPTION
The mkmsgs utility is used to create a file of text strings that can be accessed using the text retrieval tools (see gettxt(1), srchtxt(1), exstr(1), and gettxt(3C)). It will take as input a file of text strings for a particular geographic locale (see setlocale(3C)) and create a file of text strings in a format that can be retrieved by both gettxt(1) and gettxt(3C). By using the -i option, you can install the cre- ated file under the /usr/lib/locale/locale/LC_MESSAGES directory (locale corresponds to the language in which the text strings are writ- ten). inputstrings is the name of the file that contains the original text strings. msgfile is the name of the output file where mkmsgs writes the strings in a format that is readable by gettxt(1) and gettxt(3C). The name of msgfile can be up to 14 characters in length, but may not contain either (null) or the ASCII code for / (slash) or : (colon). The input file contains a set of text strings for the particular geographic locale. Text strings are separated by a newline character. Non- graphic characters must be represented as alphabetic escape sequences. Messages are transformed and copied sequentially from inputstrings to msgfile. To generate an empty message in msgfile, leave an empty line at the correct place in inputstrings. Strings can be changed simply by editing the file inputstrings. New strings must be added only at the end of the file; then a new msgfile file must be created and installed in the correct place. If this procedure is not followed, the retrieval function will retrieve the wrong string and software compatibility will be broken. OPTIONS
The following options are supported: -o Overwrite msgfile, if it exists. -i locale Install msgfile in the /usr/lib/locale/locale/LC_MESSAGES directory. Only someone who is super user or a member of group bin can create or overwrite files in this directory. Directories under /usr/lib/locale will be created if they do not exist. EXAMPLES
Example 1: Using the mkmsgs command. The following example shows an input message source file C.str: File %s: cannot be opened %s: Bad directory . . . write error . . Example 2: Using Input Strings From C.str to Create Text Strings in a File The following command uses the input strings from C.str to create text strings in the appropriate format in the file UX in the current directory: example% mkmsgs C.str UX Example 3: Using Input Strings From FR.str to Create Text Strings in a File The following command uses the input strings from FR.str to create text strings in the appropriate format in the file UX in the directory /usr/lib/locale/fr/LC_MESSAGES: example% mkmsgs -i fr FR.str UX These text strings would be accessed if you had set the environment variable LC_MESSAGES=fr and then invoked one of the text retrieval tools listed at the beginning of the DESCRIPTION section. FILES
/usr/lib/locale/locale/LC_MESSAGES/* message files created by mkmsgs ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |Availability |SUNWloc | +-----------------------------+-----------------------------+ SEE ALSO
exstr(1), gettxt(1), srchtxt(1), gettxt(3C), setlocale(3C), attributes(5) SunOS 5.10 26 Jul 1994 mkmsgs(1)
All times are GMT -4. The time now is 04:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy