stat function in BASH...
Hello,
I have a bit of a problem with this command in bash: DATE=$(date -d "+$(stat $file | grep Modify | cut -c 9-)" +%Y%m%d) this should normally give me the last modification date of the "$file", and it works when I use it normally, but when the $file is in a "linked" ( ln -s ) directory, he says that he cannot stat the file... (gives an error on stat). Is there a workaround for this? so that I can stat the files in the "linked" directory? Many thanks in advance, PF |
Install the "realpath" utility and call it on your file in your script.
IIRC it's more or less Debian-specific. So if you use Debian: apt-get install realpath If not, get the sources from the debian site or compile your own quick & dirty one from this source: Code:
#include <limits.h> |
All times are GMT -5. The time now is 09:09 AM. |