> I'm new to pass and I was wondering, is there a way to view how old a pass 
> is? 
> (or the creation date of it).

If you are using git with your pass, then you can run something like
this. It determines the age of the first line of the password file.

print_age() {
    filename="$1"

    cur_time=$(date --date="now" +"%s")
    ch_time=$(git blame -L 1,1 "${filename}" --porcelain --date=relative | sed 
-n 's/^committer-time //p')
    alt=$(echo "(${cur_time} - ${ch_time})/(60*60*24)" | bc)

    echo "${alt} days - ${filename}"
}
export -f print_age
parallel print_age ::: $(git ls-tree -r --name-only HEAD)

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Password-Store mailing list
[email protected]
https://lists.zx2c4.com/mailman/listinfo/password-store

Reply via email to