Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "shell out" or "shelling out" mean?

Tags:

unix

ruby

bundler

As used in these examples, for instance:

shell out to bundle from inside a command invoked by bundle exec

or

shell out to a Ruby command that is not part of your current bundle,

http://bundler.io/man/bundle-exec.1.html

or

i'm shelling out to the heroku command in the rake task

https://github.com/sstephenson/rbenv/issues/400

like image 985
Magne Avatar asked Feb 20 '15 12:02

Magne


2 Answers

It means executing a subprocess using backticks (as in `command`), the system call, or other similar methods. These execute the process in a sub-shell, hence the name.

You can find a lot more details in this answer: https://stackoverflow.com/a/18623297/29470

like image 197
Tim Moore Avatar answered Nov 08 '22 19:11

Tim Moore


Spawning a pipeline of connected programs via an intermediate shell — a.k.a. “shelling out”

http://julialang.org/blog/2012/03/shelling-out-sucks/

And the related reddit comment thread: http://www.reddit.com/r/programming/comments/1bwbyf/shelling_out_sucks/

So, from what I can gather, I presume it means "going out from the context of the executing program, to the surrounding program, or execution environment", in broad terms. Usually you go out to the unix shell, hence the term shell out.

like image 27
Magne Avatar answered Nov 08 '22 19:11

Magne