You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
#!/usr/bin/env bash
|
|
|
|
# Outputs the seconds since the thing identified by the first argument
|
|
# was last modified (not created).
|
|
|
|
ageof() {
|
|
local path="$1"
|
|
if [[ -z "$path" ]]; then
|
|
echo 'usage: ageof <path>'
|
|
return 1
|
|
fi
|
|
echo $(( $(date +%s) - $(date -r "$path" +%s) ))
|
|
}
|
|
|
|
ageof "$@"
|