79276307

Date: 2024-12-12 19:11:01
Score: 1
Natty:
Report link

Use a subshell to delay the evaluation of $EPOCHREALTIME. This way, it will be evaluated each time the trap is triggered.

trap 'PS1_STARTTIME=$(echo $EPOCHREALTIME)' DEBUG
export PS1="\$(printf '%0.3f' \$(bc <<< \"\$EPOCHREALTIME - \$PS1_STARTTIME\")) \w \\$ "
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Silver Spade