1

After a command in bash i want the execution time for that command redirect to file but not use time before every command. I try trap but I can't redirect trap output to file. I also try PROMPT_COMMAND; but this environment variable run after user command not before it. What I mean:

$ nano Foo.txt

and in the log file or output (generally stdout):

nano Foo.txt: 14:38

(for instance)

I try use PS0 and PS1 but PS0 for bash version least 4.4 and my bash in workplace lower

ahs.cs
  • 11
  • 2
  • Have you looked into [Use PS0 and PS1 to display execution time of each bash command](https://stackoverflow.com/q/43201274/3266847)? – Benjamin W. Oct 16 '20 at 16:07

0 Answers0