Sponsored Content
Full Discussion: cp | greb
Top Forums Shell Programming and Scripting cp | greb Post 302667989 by bartus11 on Sunday 8th of July 2012 10:25:56 AM
Old 07-08-2012
statis used to read file's modification date and awk is used to filter files that were modified between 9:00 and 17:30. If this code gives you proper results, then you can copy those files using:
Code:
stat -c "%y %n" * | awk -F"[ :]" '$2>=9&&$2<17||$2==17&&$3<=30{print $6}' | xargs -i cp {} /somewhere/else

This User Gave Thanks to bartus11 For This Post:
 
All times are GMT -4. The time now is 05:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy