1
time seq 100 | xargs -i bash -c 'echo {}'

; 2.530s

time seq 100 | xargs -i sh -c 'echo {}'

; 0.223s

why?

PS: The title of mine for this post is more intuitive to be discovered or searched by google or any sort of search engines.

dessert
  • 39,392
  • 12
  • 115
  • 163
user58029
  • 141
  • 7
  • 3
    Related: [What is the point of sh being linked to dash?](https://askubuntu.com/q/976485/816190). Your actual question would be like: "Why bash is slower than sh"? – Kulfy Feb 11 '19 at 09:16
  • The short answer is because `sh` is symlink to `/bin/dash`, which is different from `/bin/bash`, and `/bin/sh` symlinked to `/bin/dash` exactly because it's considerably faster shell – Sergiy Kolodyazhnyy Feb 11 '19 at 10:24

0 Answers0