#!/usr/bin/env sh set -eu #o pipefail cachedir=${XDG_CACHE_HOME:-"$HOME/.cache"} if [ -d "$cachedir" ]; then cache=$cachedir/run_list else cache=$HOME/.run_list fi #if [ ! -f "$cache" ] || [ $(find "$cache" -mmin +180) = "$cache" ]; then IFS=':' if [ ! -f "$cache" ] || [ $(find $PATH -prune -cnewer "$cache" 2>/dev/null |\ head -c1 | wc -c) -eq 1 ]; then find -L $PATH -maxdepth 1 -type f -executable -printf "%f\n" 2>/dev/null |\ sort -u | tee "$cache" else cat "$cache" fi