执行从Common Lisp的shell命令 [英] Executing a shell command from Common Lisp

查看:1037
本文介绍了执行从Common Lisp的shell命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何能的Common Lisp程序中执行shell(bash)的命令,将输出分配给一个变​​量?

How can i execute a shell (bash) command within a Common Lisp program and assign the output to a variable?

推荐答案

ASDF 提供了一个 RUN-SHELL-COMMAND 与许多Common Lisp的实施,包括ABCL,快板CL,CLISP,Clozure CL,ECL,保利协鑫,LispWorks,SBCL,CMU,XCL和作品SCL。

ASDF provides a RUN-SHELL-COMMAND that works with many Common Lisp implementations including ABCL, Allegro CL, CLISP, Clozure CL, ECL, GCL, LispWorks, SBCL, CMU, XCL and SCL.

这需要一个控制字符串,如 FORMAT 参数列表,并同步使用Bourne兼容的shell执行的结果。通过结合一个可选的流捕获输出。

It takes a control string and a list of arguments like FORMAT, and synchronously executes the result using a Bourne-compatible shell. Capture output by binding an optional stream.

这篇关于执行从Common Lisp的shell命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆