Sponsored Content
Full Discussion: Check the Files existence
Top Forums Shell Programming and Scripting Check the Files existence Post 302843001 by RudiC on Sunday 11th of August 2013 02:22:00 PM
Old 08-11-2013
When encountering that msgs, you need to escape the * in your find command (as do MadeInGermany and kshji)
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

check for FILES existence

hi, I have a list of filenames and I want to verify if they all exist. I know "if filename" would do the trick but how do I go about a list of files? thanks (3 Replies)
Discussion started by: mpang_
3 Replies

2. AIX

check for file existence

Hello I am having a requirement like if there is no file in the directory then i need a message to pop on after the execution of the script. My script basically does for File in `ls -t $DIRECTORY | tail -1`; if there is no file the DIRECTORY then the script is simply exiting with out... (2 Replies)
Discussion started by: dsdev_123
2 Replies

3. AIX

Check for File Existence

I have requirement where i need to search for files which start with SALESORDER and PURCHASEORDER. i need to process the files with SALESORDER first and then PURCHASEORDER. If SALESORDER files are not there i dont want to process PURCHASEORDER and i want to come out of script. I have written a code... (4 Replies)
Discussion started by: dsdev_123
4 Replies

4. Shell Programming and Scripting

How to check for file existence?

i want to check if the file is in the directory or not, and also it should be handle error conditions, like missing files and report the error and exit. i did something like this: file ="hello" if !test -e "${file}" then echo "No such files exist!" exit 1 else do something....... fi ... (1 Reply)
Discussion started by: mingming88
1 Replies

5. Shell Programming and Scripting

Check existence of a number of files and call other scripts

Hi, I am new to unix scripting and am jus getting to learn about it.. I need to know on how to check for the existence of a number of files in a path..i.e the files are ftp'ed from several other servers, should check if all the files have arrived, if not wait till they arrive..can i use a flag... (5 Replies)
Discussion started by: yohasini
5 Replies

6. UNIX for Dummies Questions & Answers

To check for existence of a file

I need to check for the existence of a file *.log in a specific directory using a perl script. Presently am not in that particular directory. So i am using chdir ("/path/to/my/file) And then i am using the -e in an if statement to check if it exists. if (-e $File) {......} $File contains the... (1 Reply)
Discussion started by: manutd
1 Replies

7. Shell Programming and Scripting

check existence of files in a folder

Hi I am having a problem to verify existence of files. I need to know whether or not files in a folder that begins with a name. For example all files that start with The_File_ *. I was doing it this way, but gives me error. if text -f /work/The_File_* then ... else .. fi (5 Replies)
Discussion started by: Rodrih92
5 Replies

8. Shell Programming and Scripting

Check for the existence and add them from 2 different files

Hi, I have two files file1: ALEX DANY GARY TOM MARY HARRIS file2: ALEX 3 ALEX 5 ALEX 0 ALEX 1 ALEX 0 DANY 2 (2 Replies)
Discussion started by: Diya123
2 Replies

9. Shell Programming and Scripting

File existence check

hi i wanted to check if the file exist or not(multiple files) DIRE=/home/V478 if ; then echo "file present" else echo "file not present" fi But i am getting the error as : [: unexpected operator/operand (3 Replies)
Discussion started by: ATWC
3 Replies

10. Shell Programming and Scripting

Script to check the files existence inside a directory.

Hello Folks, On Below Script, I want to apply condition. Condition that it check the directory for files if not found keep checking. Once directory have files and founded do the calculation and finish the code. Script to check the files existence inside a directory, If not then keep... (16 Replies)
Discussion started by: sadique.manzar
16 Replies
MHPATH(1)                                                            [nmh-1.5]                                                           MHPATH(1)

NAME
mhpath - print full pathnames of nmh messages and folders SYNOPSIS
mhpath [+folder] [msgs] [-version] [-help] DESCRIPTION
mhpath expands and sorts the message list `msgs' and writes the full pathnames of the messages to the standard output separated by new- lines. If no `msgs' are specified, mhpath outputs the current mail folder's pathname instead. If the only argument is `+', your nmh "Path" is output; this can be useful in shell scripts. Contrasted with other nmh commands, a message argument to mhpath may often be intended for writing. Because of this: 1) the name "new" has been added to mhpath's list of reserved message names (the others are "first", "last", "prev", "next", "cur", and "all"). The new message is equivalent to the message after the last message in a folder (and equivalent to 1 in a folder without mes- sages). The "new" message may not be used as part of a message range. 2) Within a message list, the following designations may refer to messages that do not exist: a single numeric message name, the single message name "cur", and (obviously) the single message name "new". All other message designations must refer to at least one existing message, if the folder contains messages. 3) An empty folder is not in itself an error. A message number less than that of the smallest existing message in a folder is treated as if the message already exists. A message number greater than that of the highest existing message in a folder causes an "out of range" error message to be displayed. As part of a range designation that contains messages that do exist, message numbers less than the smallest, or greater than the highest, existing message in a folder are ignored. Examples: The current folder foo contains messages 3 5 6. Cur is 4. % mhpath /r/phyl/Mail/foo % mhpath all /r/phyl/Mail/foo/3 /r/phyl/Mail/foo/5 /r/phyl/Mail/foo/6 % mhpath 2001 mhpath: message 2001 out of range 1-6 % mhpath 1-2001 /r/phyl/Mail/foo/3 /r/phyl/Mail/foo/5 /r/phyl/Mail/foo/6 % mhpath new /r/phyl/Mail/foo/7 % mhpath last new /r/phyl/Mail/foo/6 /r/phyl/Mail/foo/7 % mhpath last-new mhpath: bad message list last-new % mhpath cur /r/phyl/Mail/foo/4 % mhpath 1-2 mhpath: no messages in range 1-2 % mhpath first:2 /r/phyl/Mail/foo/3 /r/phyl/Mail/foo/5 % mhpath 1 2 /r/phyl/Mail/foo/1 /r/phyl/Mail/foo/2 mhpath is also useful in back-quoted operations: % cd `mhpath +inbox` % echo `mhpath +` /r/phyl/Mail FILES
$HOME/.mh_profile The user profile PROFILE COMPONENTS
Path: To determine the user's nmh directory Current-Folder: To find the default current folder SEE ALSO
folder(1) DEFAULTS
`+folder' defaults to the current folder `msgs' defaults to none CONTEXT
None BUGS
Like all nmh commands, mhpath expands and sorts [msgs]. So don't expect mv `mhpath 501 500` to move 501 to 500. Quite the reverse. But mv `mhpath 501` `mhpath 500` will do the trick. Out of range message 0 is treated far more severely than large out of range message numbers. MH.6.8 11 June 2012 MHPATH(1)
All times are GMT -4. The time now is 03:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy