4 ms·
Given that sh can print everything as it runs, it would be nice to know what is it that takes so long, instead of doing a full rewrite. I remember once replaci
by nmz 2y ago
Given that sh can print everything as it runs, it would be nice to know what is it that takes so long, instead of doing a full rewrite.
I remember once replacing a filter written in pure bash by an awk one, the slowdown was around 2 minutes v awk which was a second.
- kelsey98765431 2y agoedit 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