- put in
/usr/local/bin/lastmod
or/usr/bin/lastmod
$ lastmod http://example.com [http://example.com/foo http://example.com/bar ...]
for inside of Cygwin
direct input to console, like this:
$ date --rfc-3339="seconds" -d "`wget -S --spider http://s.hatena.ne.jp/js/HatenaStar.js 2>&1 |\
> grep -o -P "Last-Modified:.*" --line-buffered |\
> sed -u -r "s/Last-Modified:\s//"`"
2012-05-22 12:13:51+09:00
$ uname -a
CYGWIN_NT-5.1 %CONPUTERNAME% 1.5.25(0.156/4/2) 2008-06-12 19:34 i686 Cygwin
$ wget --version
GNU Wget 1.11.4
$ curl --version
curl 7.16.3 (i686-pc-cygwin) libcurl/7.16.3 OpenSSL/0.9.8l zlib/1.2.3 libssh2/0.15-CVS
$ grep --version
GNU grep 2.5.3
$ date --version
date (GNU coreutils) 6.10
for msysGit(MinGW), Cygwin or old Distribution
direct input to console, like this:
$ date "+%Y-%m-%d %T%z" -d "`curl -sI http://s.hatena.ne.jp/js/HatenaStar.js |\
> grep -e "Last-Modified: " |\
> sed -u -r "s/Last-Modified:\s//"`"
2012-05-22 12:13:51+0900
$ uname -a
MINGW32_NT-5.1 %CONPUTERNAME% 1.0.12(0.46/3/2) 2011-07-20 17:52 i686 unknown
$ curl --version
curl 7.21.1 (i686-pc-mingw32) libcurl/7.21.1 OpenSSL/0.9.8r zlib/1.2.3
$ grep --version
grep (GNU grep) 2.4.2
$ date --version
date (GNU sh-utils) 2.0