Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以我打算在这里做的是创建一个脚本的一部分,它可以用 µtorrent(通过 wine)打开一个或多个 torrent。
Wine 路径需要像这样附加到参数中(循环显然不起作用):
for i in "$@"; do open="Z:/$(pwd)/$i" done wine utorrent "$open"
我会使用一个数组:
args=() pwd=$(pwd) for i; do args+=("z:/$pwd/$i") done wine utorrent "${args[@]}"
在 bashfor循环中,如果您省略该in ...子句,则默认情况下它会迭代"$@"。
for
in ...
"$@"