Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Directory find in small and capitals Post 7035 by LivinFree on Tuesday 18th of September 2001 03:48:06 AM
Old 09-18-2001
What about :
find . -type d -print | grep -i "backup"*
Or something simialr to your needs.
The "-i" flag to grep make the search not case sensitive (this should work on all Unices - let me know if it doesn't).

HTH
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

how to find a file named vijay in a directory using find command

I need to find whether there is a file named vijay is there or not in folder named "opt" .I tried "ls *|grep vijay" but it showed permission problem. so i need to use find command (6 Replies)
Discussion started by: amirthraj_12
6 Replies

2. UNIX for Dummies Questions & Answers

Script to find a string in a directory/sub-directory

I'm trying to find this string 'preparing string IBE_Quote_W1_Pvt.SaveWrapper for quote_header_id’ in my Apache log file directory. The log file that contains this string may be in a parent direcotry or a sub-directory. I have tried 'grep' and 'awk' with no success. I would like to get the path... (3 Replies)
Discussion started by: gross
3 Replies

3. Shell Programming and Scripting

[[HelloInCapitals]] to [[Hello In Capitals]]

Hello community, I got it all done except for one thing, ] or ] So now I want to split those in to ] or ] I am not so good at all this and get stuck with sed -e 's// &/g' -e 's/.../ &/g' -e 's/^ //g' infile (11 Replies)
Discussion started by: externalaw
11 Replies

4. Shell Programming and Scripting

Find Directory help

Hey All, New to Bash Scripting I have a find command to count the current directories it is: dirCount=`find $2/ -type d | wc -l` What I get is a count of all directories in $2 as well as $2 itself. What I need to do is ignore $2 itself and just get the folders inside $2. Thank in... (6 Replies)
Discussion started by: brandonpal
6 Replies

5. UNIX for Advanced & Expert Users

find directory help

I am looking for the directory ".Private". Can someone tell me why my first search does not work? ~ $ sudo find / -iname -type d ".Private" 2>/dev/null And why does this one work? ~ $ sudo find / -type d -iname '.Private' 2>/dev/null... (3 Replies)
Discussion started by: cokedude
3 Replies

6. Shell Programming and Scripting

Do not find the mistake in a small routine!!!

Have a textfile (regular updated) with informations about datafiles . Each line is describing a datafile. Now I am trying to delete several specific lines in this textfile, which are defined before in a kind of removal list. Can not find the mistake I have done in the script because in the... (5 Replies)
Discussion started by: jurgen
5 Replies

7. UNIX for Dummies Questions & Answers

"-maxdepth 1" argument for Solaris find. Other way to restrict find in only one directory?

Hi I wish to find only files in dir /srv/container/content/imz06/. It means exclude subfolder /srv/container/content/imz06/archive/ > uname -a SunOS testbox6 5.10 Generic_139555-08 sun4v sparc SUNW,Sun-Blade-T6320Its Solaris default "find" > find /srv/container/content/imz06/* -name... (4 Replies)
Discussion started by: slashdotweenie
4 Replies

8. Shell Programming and Scripting

Find every directory named XYZ under the DVLP directory

I only want to find files under each branch of the directory tree inside directories named XYZ and there are multiple XYZ directories? (7 Replies)
Discussion started by: emc^24sho
7 Replies

9. Shell Programming and Scripting

Find words containing small letters

Hello, I have a file containing different words. How can i print the words which contain at least one small letter, for example if i have: today TOMORROw 12345 123a next preViou5 no it should print the following: today TOMORROw 123a next preViou5 no Please use code tags as required... (5 Replies)
Discussion started by: JhonTheNewbie
5 Replies

10. UNIX for Beginners Questions & Answers

How to find and get a file in an entire directory with an excluded directory specified?

How to get a file 'zlib.h' in an entire directory with an excluded directory specified lives under that starting directory by using find command, as it failed on: $ find . -name 'zlib.h' -a -ipath 'CHROME.TMP' -prune -o -print it'll just list entirely up (2 Replies)
Discussion started by: abdulbadii
2 Replies
MAILDROPEX(7)						      Double Precision, Inc.						     MAILDROPEX(7)

NAME
maildropex - maildrop filtering language examples SYNOPSIS
$HOME/.mailfilter, $HOME/.mailfilters/* DESCRIPTION
If $HOME/.mailfilter exists, filtering instructions in this file will be carried out prior to delivering the message. The filtering instructions may instruct maildrop to discard the message, save the message in a different mailbox, or forward the message to another address. If $HOME/.mailfilter does not exist, or does not provide explicit delivery instructions, maildrop delivers the message to the user's system mailbox. The files in $HOME/.mailfilters are used when maildrop is invoked in embedded mode. EXAMPLES
Take all mail that's sent to the 'auto' mailing list, and save it in Mail/auto. The 'auto' mailing list software adds a "Delivered-To: auto@domain.com" header to all messages: if (/^Delivered-To: *auto@domain.com$/) to Mail/auto After the to command delivers the message, maildrop automatically stops filtering and terminates without executing the subsequent instructions in the filter file. Take all mail from boss@domain.com about the current project status, save it in Mail/project, then forward a copy to John: if (/^From: *boss@domain.com/ && /^Subject:.*[:wbreak:]project status[:wbreak:]/) { cc "!john" to Mail/project } Note that it is necessary to use a backslash in order to continue the if statement on the next line. Keep copies of the last 50 messages that you received in the maildir directory 'backup'. NOTE: 'backup' must be a maildir directory, not a mailbox. You can create a maildir using the maildirmake command. cc backup `cd backup/new && rm -f dummy `ls -t | sed -e 1,50d`` Put this at the beginning of your filter file, before any other filtering instructions. This is a good idea to have when you are learning maildrop. If you make a mistake and accidentally delete a message, you can recover it from the backup/new subdirectory. Save messages that are at least 100 lines long (approximately) into Mail/IN.Large:: if ( $LINES > 100 ) to Mail/IN.Large Send messages from the auto mailing list to the program 'archive', using a lock file to make sure that only one instance of the archive program will be running at the same time: if (/^Delivered-To: *auto@domain.com$/) dotlock "auto.lock" { to "|archive" } Check if the Message-ID: header in the message is identical to the same header that was recently seen. Discard the message if it is, otherwise continue to filter the message: `reformail -D 8000 duplicate.cache` if ( $RETURNCODE == 0 ) exit The reformail[1] command maintains a list of recently seen Message-IDs in the file duplicate.cache. Here's a more complicated example. This fragment is intended to go right after the message has been filtered according to your regular rules, and just before the message should be saved in your mailbox: cc $DEFAULT xfilter "reformail -r -t" /^To:.*/ getaddr($MATCH) =~ /^.*/; MATCH=tolower($MATCH) flock "vacation.lock" { `fgrep -iqx "$MATCH" vacation.lst 2>/dev/null || { echo "$MATCH" >>vacation.lst ; exit 1 ; } ` } if ( $RETURNCODE == 0 ) exit to "| ( cat - ; echo ''; cat vacation.msg) | $SENDMAIL" This code maintains a list of everyone who sent you mail in the file called vacation.lst. When a message is received from anyone that is not already on the list, the address is added to the list, and the contents of the file vacation.msg are mailed back to the sender. This is intended to reply notify people that you will not be answering mail for a short period of time. The first statement saves the original message in your regular mailbox. Then, xfilter[2] is used to generate an autoreply header to the sender. The To: header in the autoreply - which was the sender of the original message - is extracted, and the getaddr[3] function is used to strip the person's name, leaving the address only. The file vacation.lst is checked, using a lock file to guarantee atomic access and update (overkill, probably). Note that the backslashes are required. If the address is already in the file, maildrop exits, otherwise the contents of vacation.msg are appended to the autoreply header, and mailed out. Note An easier to make a vacation script is with mailbot(1)[4]. Here's a version of the vacation script that uses a GDBM database file instead. The difference between this script and the previous script is that the previous script will send a vacation message to a given E-mail address only once. The following script will store the time that the vacation message was sent in the GDBM file. If it's been at least a week since the vacation message has been sent to the given address, another vacation message will be sent. Even though a GDBM database file is used, locking is still necessary because the GDBM library does not allow more than one process to open the same database file for writing: cc $DEFAULT xfilter "reformail -r -t" /^To:.*/ getaddr($MATCH) =~ /^.*/; MATCH=tolower($MATCH) flock "vacation.lock" { current_time=time; if (gdbmopen("vacation.dat", "C") == 0) { if ( (prev_time=gdbmfetch($MATCH)) ne "" && $prev_time >= $current_time - 60 * 60 * 24 * 7) { exit } gdbmstore($MATCH, $current_time) gdbmclose } } to "| ( cat - ; echo ''; cat vacation.msg) | $SENDMAIL" This script requires that maildrop must be compiled with GDBM support enabled, which is done by default if GDBM libraries are present. After you return from vacation, you can use a simple Perl script to obtain a list of everyone who sent you mail (of course, that can also be determined by examining your mailbox). SEE ALSO
maildrop(1)[5], maildropfilter(7)[6], reformail(1)[1], mailbot(1)[4], egrep(1), grep(1), sendmail(8). AUTHOR
Sam Varshavchik Author NOTES
1. reformail [set $man.base.url.for.relative.links]/reformail.html 2. xfilter [set $man.base.url.for.relative.links]/maildropfilter.html#xfilter 3. getaddr [set $man.base.url.for.relative.links]/maildropfilter.html#getaddr 4. mailbot(1) [set $man.base.url.for.relative.links]/mailbot.html 5. maildrop(1) [set $man.base.url.for.relative.links]/maildrop.html 6. maildropfilter(7) [set $man.base.url.for.relative.links]/maildropfilter.html Courier Mail Server 08/30/2011 MAILDROPEX(7)
All times are GMT -4. The time now is 08:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy