Perl and PHP do this with backticks. For example,
$output = `ls`;
Returns a directory listing. A similar function, system(\"foo\")
Ruby: either backticks or the '%x' builtin syntax.
puts `ls`;
puts %x{ls};
An alternative method in perl
$output = qx/ls/;
This had the advantage that you can choose your delimiters, making it possible to use ` in the command (though IMHO you should reconsider your design if you really need to do that). Another important advantage is that if you use single quotes as delimiter, variables will not be interpolated (a very useful)
Lua:
foo = io.popen("ls"):read("*a")