tips.paddyonline.net

If you need tips & tricks, here they are...

Compare time on two files in (T)CSH

Compare time on two files in (T)CSH

I really don't like BASH or SH so I try to find ways not to use it.

This is what I came up to for use instead of [< file > -lt < file2 >] compare

if ( (-M < file1 >) >= (-M < file2 > ) )


example

if ( (-M file1) >= (-M file2 ) ) then
echo "file1 is newer then file2"
endif

The added benefit is that you can change the order to do the same as -ot or add more compare options!

Add comment

Security code
Refresh

Please consider supporting our efforts.


We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.