Sponsored Content
Top Forums Shell Programming and Scripting Find if a directory exist from a list of the path Post 302938834 by steiner on Thursday 19th of March 2015 09:18:04 AM
Old 03-19-2015
Check directory exist

Hello

thanks for your reply,

My Problem now is that all my paths are in a virtual list.

I need just the command like :

Code:
echo "$params"|while read param
do
{
echo $params
#if [ -d "/var/mqm/qmgr/"$params"ssl/" ]; then
#       echo "The directory exists"
#else
#       echo "Does not exist"
#fi
}
done


But it make more loop that name in the list

thanks

Last edited by vgersh99; 03-19-2015 at 10:19 AM.. Reason: code tags, please!
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

List the files without directory path

Hi I am writing a script to find the list of files in dir1 and my script is place in dir2 while doing ls of files dir1 it is displaying with path. I would like to omit the path and display the only file name so that I can pass it to my script as arguments. for filename in ... (2 Replies)
Discussion started by: madankumar
2 Replies

2. UNIX for Dummies Questions & Answers

To list all the files created today with directory path

Hi, Can any one tell the command to list all the files that are created as of today from all the directories? The Command "ls -ltR" is listing all the files. But I want the list of files that has been created as of today along with the directory path:) Thank you in advance.:) Regards,... (4 Replies)
Discussion started by: meetusha.b
4 Replies

3. UNIX for Dummies Questions & Answers

how to find a path within unix root directory

I need to know whether nyfile/mypath exists on the file system in the root directory. How to do this (1 Reply)
Discussion started by: ramky79
1 Replies

4. AIX

AIX cp error: "A file or directory in the path does not exist"

Hello fellow UNIX fans, I'm running AIX 4.3 and getting an error message “cp: /a/file2.db: A file or directory in the path does not exist” when I run the following command: cp /b/file.db /a/file2.db It stops every time about 95% of the way through the copy process at 1,073,741,312 bits. ... (3 Replies)
Discussion started by: Jackson123
3 Replies

5. UNIX for Dummies Questions & Answers

How to find if file exist in directory using *

Hi, I know how to use the test command ( ...) to find a single given name file. However, I have a case in which I have a directory with one file and one sub-directory. I know that the file starts with "fub". The command doesn't work if i call the file "fub*" as it doesn't understand I meant a... (2 Replies)
Discussion started by: buj
2 Replies

6. UNIX for Advanced & Expert Users

Find exact path of a file/directory

Hello Folks, A wrapper takes an argument of file or directory name. I want to allow paths that reside within the current directory only. Can simply discard the paths like "/A" & "../" as they go outside the current by looking at the path beginning. How to validate this one: A/../../../b... (4 Replies)
Discussion started by: vibhor_agarwali
4 Replies

7. Shell Programming and Scripting

a little help with find and directory path for application

Just a little backgroud, I have a library of mp3 files in the following structure: /mp3/artist/album/track.mp3 Also contained in each album directory is a cover.jpg which contains the cover art file for that particular album. I want to add the cover.jpg to the mp3 tag and have been using... (8 Replies)
Discussion started by: barrydocks
8 Replies

8. Shell Programming and Scripting

find + move if destination path does not exist

hi frnds, please help ... what will happen with below command if destination path does not exist on the system.... find /var/adm/cft* -mtime +1 -exec mv {} /global/ \ in unix its remove all my files from the system from soruce file ... how is it possbile (1 Reply)
Discussion started by: dodasajan
1 Replies

9. Shell Programming and Scripting

Find file and zip without including directory path

Does anyone know of a way to zip the resulting file from a find command? My approach below finds the file and zips the entire directory path, which is not what I need. After scanning the web, it seems to be much easier to perform gzip, but unfortunately the approach must use zip. find `$DIR`... (5 Replies)
Discussion started by: koeji
5 Replies

10. UNIX for Beginners Questions & Answers

A file or directory in the path does not exist

I'm brand new to AIX and I looked up how to print this file and it was working but now I'm not able to do it all of a sudden. the file name is rom1.txt so this is what i wrote in the command line and I know I'm in the right directory. In bold is what I seem to be messing up with. prod @ root... (3 Replies)
Discussion started by: Dark0Prince
3 Replies
unlink(2)							System Calls Manual							 unlink(2)

NAME
unlink - remove directory entry; delete file SYNOPSIS
DESCRIPTION
The system call removes the directory entry named by the path name pointed to by path. When all links to a file have been removed and no process has the file open, the space occupied by the file is freed and the file ceases to exist. If one or more processes have the file open when the last link is removed, only the directory entry is removed immediately so that processes that do not already have the file open cannot access the file. After all processes close their references to the file, if there are no more links to the file, the space occupied by the file is then freed and the file ceases to exist. RETURN VALUE
returns the following values: Successful completion. Failure. is set to indicate the error. ERRORS
If fails, is set to one of the following values: Search permission is denied for a component of the path prefix. Write permission is denied on the directory containing the link to be removed. The process does not have read/write access permission to the parent directory. The entry to be unlinked is the mount point for a mounted file system. path points outside the process's allocated address space. The reliable detection of this error is implementation dependent. Too many symbolic links were encountered in translating the path name. The length of the specified path name exceeds bytes, or the length of a component of the path name exceeds bytes while is in effect. The named file does not exist (for example, path is null or a component of path does not exist). A component of the path prefix is not a directory. The directory containing the file to be removed has the sticky bit set and neither the containing directory nor the file to be removed are owned by the effective user ID. The named file is a directory and the effective user ID is not a user with appropriate privileges. Some file systems return this error whenever the named file is a directory, regardless of the user ID. The directory entry to be unlinked is part of a read-only file system. The entry to be unlinked is the last link to a pure procedure (shared text) file that is being executed. WARNINGS
If is used on a directory that is not empty (contains files other than and the directory is unlinked, the files become orphans, and the directory link count is left with an inaccurate value unless they are linked by some other directory. If is used on a directory that is empty (contains only the files and the directory is unlinked, but the parent directory's link count is left with an inaccurate value. In either of the above cases, the file system should be checked using (see fsck(1M)). To avoid these types of problems, use instead (see rmdir(2)). SEE ALSO
rm(1), close(2), link(2), open(2), rmdir(2), remove(3C), privileges(5). STANDARDS CONFORMANCE
unlink(2)
All times are GMT -4. The time now is 11:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy