小编use*_*ser的帖子

拦截并修改bash脚本中的命令

我有一些脚本,脚本中的一些命令是这样的

./executable arg1 arg2 .. argn

我想将上面的命令更改为

LD_PRELOAD=/some/lib ./executable my_arg1 my_argn arg1 arg2 argn; some_other_command

更改脚本的一种方法,但我不想这样做,而是想拦截这些命令,更改这些命令并运行它们。我怎样才能做到这一点?

shell bash shell-script

4
推荐指数
1
解决办法
2119
查看次数

标签 统计

bash ×1

shell ×1

shell-script ×1