【发布时间】:2011-07-29 09:02:58
【问题描述】:
是否可以在一个 exec 命令中运行多个命令?我需要从 SVG 文件中抓取一些图像,但这个变体太慢了:
exec('inkscape file.svg --export-id=g123 --export-png=img1.png');
exec('inkscape file.svg --export-id=g124 --export-png=img2.png');
exec('inkscape file.svg --export-id=g125 --export-png=img3.png');
所以我需要在一行中完成所有操作。我已经试过了:
exec('inkscape file.svg --export-id=g125 --export-png=img3.png inkscape file.svg --export-id=g123 --export-png=img1.png');
但这只会提取最后一张图片。
【问题讨论】: