linux-admin.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Find command in shell script
@ 2002-06-18  2:24 Rowan Eppelstun
  2002-06-18  5:19 ` rDNS blocked Kilaru Sambaiah
  2002-06-18  6:57 ` Find command in shell script Camelia NASTASE
  0 siblings, 2 replies; 3+ messages in thread
From: Rowan Eppelstun @ 2002-06-18  2:24 UTC (permalink / raw)
  To: linux-admin

Hi,

I am trying to do the following command in a script but cannot seem to get
the escape characters right for the find - exec mv command.

I am trying to move all files named 200206*.pdf to a subdirectory of their
currnet directory called "jun". Once I get the syntax correct for this I
will automate it for the year, but have got stuck at this bit.

Could anyone please advise what I am missing.
----------------------------------------------------------------------------
-------------
#!/bin/sh

MONTH='date +%m'
DATE='date +%Y%m'
DIR=/home/rowan/eod/2002/ba

if DATE=200206; then FILENAME="'200206*.pdf'"
fi

if MONTH=06 ; then MONDIR=$DIR/jun/
fi

cd $DIR

pwd

find ./ -name $FILENAME -exec mv -f '{}' $MONDIR ';'

exit 0
----------------------------------------------------------------------------
------------------

Thanks in advance.


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-06-18  6:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-06-18  2:24 Find command in shell script Rowan Eppelstun
2002-06-18  5:19 ` rDNS blocked Kilaru Sambaiah
2002-06-18  6:57 ` Find command in shell script Camelia NASTASE

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).