【发布时间】:2018-03-10 03:19:28
【问题描述】:
我想在ideone 上使用some-script.sh foo 测试一个shell 脚本。
在 Python 中,我们可能会执行类似sys.argv.extend('foo') 的操作来模拟命令行参数。
如何在 bash 中模拟命令行参数?
【问题讨论】:
-
使用
$1,$2,...$n -
或者
$*或者"$@"
标签: bash shell command arguments line