title: How can I profile a Bash shell script slow startup?
body: <p>My Bash shell takes up to 3-4 seconds to start up, while if I start it with <code>--norc</code> it runs immediately.</p>
  <p>I started &quot;profiling&quot; <code>/etc/bash.bashrc</code> and <code>~/.bashrc</code> by manually inserting <code>return</code> statements and seeking for speed improvements, but it is not a quantitative process and it is not efficient.</p>
  <p>How can I profile my Bash scripts, and see which commands take the most time to execute?</p>