Why 'xargs bash -c' is far slower than 'xargs sh -c'? [duplicate]





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







1
















This question already has an answer here:




  • What is the point of sh being linked to dash?

    4 answers



  • What is the difference between #!/bin/sh and #!/bin/bash?

    4 answers




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.










share|improve this question















marked as duplicate by Melebius, karel, Kulfy, dessert, Sergiy Kolodyazhnyy bash
Users with the  bash badge can single-handedly close bash questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Feb 11 at 10:21


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • 3





    Related: What is the point of sh being linked to dash?. Your actual question would be like: "Why bash is slower than sh"?

    – Kulfy
    Feb 11 at 9: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 at 10:24


















1
















This question already has an answer here:




  • What is the point of sh being linked to dash?

    4 answers



  • What is the difference between #!/bin/sh and #!/bin/bash?

    4 answers




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.










share|improve this question















marked as duplicate by Melebius, karel, Kulfy, dessert, Sergiy Kolodyazhnyy bash
Users with the  bash badge can single-handedly close bash questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Feb 11 at 10:21


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.














  • 3





    Related: What is the point of sh being linked to dash?. Your actual question would be like: "Why bash is slower than sh"?

    – Kulfy
    Feb 11 at 9: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 at 10:24














1












1








1









This question already has an answer here:




  • What is the point of sh being linked to dash?

    4 answers



  • What is the difference between #!/bin/sh and #!/bin/bash?

    4 answers




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.










share|improve this question

















This question already has an answer here:




  • What is the point of sh being linked to dash?

    4 answers



  • What is the difference between #!/bin/sh and #!/bin/bash?

    4 answers




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.





This question already has an answer here:




  • What is the point of sh being linked to dash?

    4 answers



  • What is the difference between #!/bin/sh and #!/bin/bash?

    4 answers








bash sh dash-shell






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 11 at 10:06









dessert

25.5k674108




25.5k674108










asked Feb 11 at 9:09









user58029user58029

715




715




marked as duplicate by Melebius, karel, Kulfy, dessert, Sergiy Kolodyazhnyy bash
Users with the  bash badge can single-handedly close bash questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Feb 11 at 10:21


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









marked as duplicate by Melebius, karel, Kulfy, dessert, Sergiy Kolodyazhnyy bash
Users with the  bash badge can single-handedly close bash questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Feb 11 at 10:21


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.










  • 3





    Related: What is the point of sh being linked to dash?. Your actual question would be like: "Why bash is slower than sh"?

    – Kulfy
    Feb 11 at 9: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 at 10:24














  • 3





    Related: What is the point of sh being linked to dash?. Your actual question would be like: "Why bash is slower than sh"?

    – Kulfy
    Feb 11 at 9: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 at 10:24








3




3





Related: What is the point of sh being linked to dash?. Your actual question would be like: "Why bash is slower than sh"?

– Kulfy
Feb 11 at 9:16







Related: What is the point of sh being linked to dash?. Your actual question would be like: "Why bash is slower than sh"?

– Kulfy
Feb 11 at 9: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 at 10:24





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 at 10:24










0






active

oldest

votes

















0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

Questions related to Moebius Transform of Characteristic Function of the Primes

Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

List of scandals in India