Add Comment
|
Related Links
|
TrackBack
DirectoryHasFile.sh (GPL)DirectoryHasFile.sh is a Bourne Shell script that helps your custom shell scripts determine whether the specified directory contains any files. This script outputs a '1' for true and a '0' for false. DirectoryHasFile.sh is distributed as executable source code under the GNU General Public License. Please see the license agreement elsewhere on this site. UsageDirectoryHasFile.sh "directory" Chieh Cheng The original implementation of DirectoryHasFile.sh is too simple. It returns an 1 even if there are no files, but if the directory contains directories, symbolic links, etc. So I have updated it to only return 1 when it finds files. The new version is attached below. Chieh Cheng I have improved this "DirectoryHasFile.sh" script further. You can now specify file masks to look for. If the directory contains files that matches the mask(s) you specify, it will return an 1. If you do not specify any file masks, then it will return an 1 if the directory contains any file. The new version is attached below. UsageDirectoryHasFile.sh "directory" [ "file mask 1" ... "file mask N" ] Chieh Cheng Found a bug where if no files matches the last file mask, this script returns false even if the other file masks provides a match. I fixed the bug. Download the new version below. Chieh Cheng
Add Comment
|
Related Links
|
TrackBack
Did your message disappear? Read the Forums FAQ. Add CommentSpam Control | * indicates required field TrackBackTrackBack only accepted from WebSite-X Suite web sites. Do not submit TrackBacks from other sites. Send Ping | TrackBack URL | Spam Control No TrackBacks yet. TrackBack can be used to link this thread to your weblog, or link your weblog to this thread. In addition, TrackBack can be used as a form of remote commenting. Rather than posting the comment directly on this thread, you can posts it on your own weblog. Then have your weblog sends a TrackBack ping to the TrackBack URL, so that your post would show up here. Messages, files, and images copyright by respective owners. |
Products
|
Services
94 Users Online
|
Copyright © 1996 - 2024. All Rights Reserved. |