From: Nicolas Boisselier Date: Tue, 13 Sep 2016 09:33:40 +0000 (+0100) Subject: epoch2date X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=36509ea4af2beabe7e8691cceb1c8504df340a34;p=nb.git epoch2date --- diff --git a/etc/profile.d/functions b/etc/profile.d/functions index 5ab9ec46..77df31e3 100644 --- a/etc/profile.d/functions +++ b/etc/profile.d/functions @@ -601,7 +601,7 @@ function ls_users() { } function reverse() { perl -e 'print reverse <>'; } -function epoch2date() { perl -M'POSIX strftime' -e 'e2d($ARGV[0]) and exit if @ARGV; while(<>){e2d($_)}; sub e2d(){local $_=shift;s/^(\d+)/strftime("%Y-%m-%d %H:%M:%S",localtime($1))/e; print $_}' $@; } +function epoch2date() { perl -M'POSIX strftime' -e 'e2d($ARGV[0]) and print "\n" and exit if @ARGV; while(<>){e2d($_)}; sub e2d(){local $_=shift;s/^(\d+)/strftime("%Y-%m-%d %H:%M:%S",localtime($1))/e; print $_}' $@; } #function epoch2date() { perl -M'POSIX strftime' -e 'e2d while<>; sub e2d(){local $_=shift;s/^(\d+)/strftime("%Y-%m-%d %H:%M:%S",localtime($1))/e; print $_}' $@; } find_sort_mtime() {