linux - 动态调用参数作为另一个 bash 脚本的 bash 脚本

标签 linux bash

我想实现一个按以下方式运行的 bash 脚本

./script_a.sh script_b.sh $arg1 $arg2 ...

./script_a.sh 会在 $arg1 $arg2... $argn 上调用 script_b.sh 我不知道事先有多少个参数。这怎么可能?

最佳答案

尝试将其作为包装器:

#!/bin/bash
"$@"

关于linux - 动态调用参数作为另一个 bash 脚本的 bash 脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26646840/

相关文章:

Linux,查找 > zcat > wc

windows - 什么是 wget 以及如何从公共(public)目录获取图像?

linux - 如何修复 Linux 项目中的共享库 (.so) 之一?

linux - 从 Windows 上的 plink.exe 在 Linux 上执行 sudo 命令

linux - 颠覆: how to make a working-directory on debian-webserver using windows repositories?

linux - Linux 上的 CPU 限制后台进程

bash 遍历字符串中的所有字符

linux - 在 bash 中运行多个进程

Bash curl POST 二进制变量

编译.c : Undefined symbols for architecture x86_64