将其他参数传递给可执行文件

时间:2017-07-12 18:16:43

标签: bash shell parameter-passing

我通过docker运行sharelatex并在编译时需要它使用-shell-escape标志(对于某些包(铸造))。 sharelatex拨打pdflatex some arguments之类的电话来运行pdflatex。我尝试了this question

的最后一个答案

所以我将pdflatex重命名为pdflatex_orig并创建了此脚本:

#! /bin/sh
pdflatex_orig -shell-escape 

使用标志运行真实的pdflatex

问题是参数没有传递。因此,如果我运行pdflatex --v交互式shell启动。如果我运行pdflatex_orig --v,它会向我提供有关该版本的一些信息。

那么,有没有办法将参数“管道”到原始脚本+我的shell-escape标志?

1 个答案:

答案 0 :(得分:2)

使用"$@"

#!/bin/sh
pdflatex_orig -shell-escape "$@"
相关问题