Commit 0647757d authored by Juergen Nickelsen's avatar Juergen Nickelsen

Bshell

parent 1d54ad8a
......@@ -20,6 +20,17 @@ use Interp;
# Builtins get their arguments directly as a Lisp list, have names
# beginning with 'B', and are defined here (except for, well, exceptions)
sub Bshell {
my ($command, $return_output) = checkargs($_[0], 'S:e');
my $result;
if (is_nil($return_output)) {
$result = tornil(!system($command));
} else {
$result = `$command`;
}
return $result;
}
sub Bread {
my ($input) = checkargs($_[0], ':S');
if (is_nil($input)) {
......@@ -984,6 +995,8 @@ my @builtins = # [name, func, is_special, doc]
"return an expression read from stdin or &optional INPUT (a string)"],
["perl", \&Bperl, 0,
"evaluate the ARG string as Perl code and return the result"],
["shell", \&Bshell,
"run COMMAND as a shell command; &optional RETURN-OUTPUT"],
);
for my $b (@builtins) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment