3 ms·
edit the .sh, add `set +x` then pipe it to ts ``` $ cat > example.sh ; bash example.sh |ts set -x echo a sleep 3 echo b sleep 1 echo c #end + echo a
by kelsey98765431 2y ago
edit the .sh, add `set +x` then pipe it to ts
```
$ cat > example.sh ; bash example.sh |ts
set -x
echo a
sleep 3
echo b
sleep 1
echo c
#end
+ echo a
+ sleep 3
Aug 27 09:48:02 a
+ echo b
+ sleep 1
Aug 27 09:48:05 b
+ echo c
Aug 27 09:48:06 c
```
- kstrauser 2y agoYou can do all that without modifying the script or using a separate tool: PS4='+ $(date --iso-8601)\011 ' bash -x example.sh