bash scripting question

Eric R. rossiter at discoverynet.com
Thu Feb 13 19:42:04 CST 2003


Hal and Jeremy,

Thanks guys!! I saw the -d "string" in the man page but had no idea I 
could put something as simple as "2 days ago", nor did I have any idea 
it would be correctly interpreted...

Now, I guess my question is... who/what/where interprets "2 days ago" 
and how does who/what know what "2 days ago" ultimately is?

Thanks again guys,
E

Hal Duston wrote:
> On Thu, 13 Feb 2003, Eric R. wrote:
> 
>>Afternoon LugNuts,
>>
>>Ok, I have a group of directories named "save(and the date) i.e. 
>>"save021303".
>>
>>Iv'e discoverd I can make the current days directory using:
>>
>>mkdir save`date +%D | cut -c 1,2,4,5,7,8`
>>
>>My question is, how would I delete the directory that is several days 
>>old?  i.e. save021003
>>
>>rm -rf ??
>>
> 
> 
> mkdir save`date +%m%d%y`
> 
> rm -rf save`date +%m%d%y -d '3 days ago'`
> 
> Note: The -d option is specific to GNU date.
> 
> Hal
> 
> 
> 
> 




More information about the Kclug mailing list