Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting variable that includes wildcard

Status
Not open for further replies.

jgl99

Technical User
Feb 26, 2002
12
0
0
US
I want to move all logfiles from the previous day via ftp to another server and am trying to set the variable for the logname. The logfiles could look like
acdlog20030512-1407.acdlog (don't know what -1407 actually is and don't care. Just want all files that look like acdlog20030512*.acdlog

Tried

#!/bin/csh
set log_name=acdlog`date --date='yesterday' +%Y%m%d`.acdlog
echo $log_name

Script gives me acdlog20030612.acdlog
I need acdlog20030612*.acdlog

Is there a way I can do this?

Thanks
 
Something like:

ln="filename`date --date='yesterday' +%Y%m%d`*.log"

function all_logs() {
action=${1:-"echo"}

for all in `eval $ln`
do
eval $action $all
done
return
}

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top