Under the OpenBSD
ksh the following works
Code:
PS1="\$(date +'%H:%M:%S')"
23:24:31
23:24:35
23:24:35sleep 60
23:25:44
23:29:23
23:29:52
Instead of using backticks, I use the
$( ..... )construct. To prevent it from executing at read/compile time, the leading dollar sign is escaped with a '\'.
Because '\' only works when the shell gets to interpret it, double quotes (") were used instead of single quotes (').