Вопрос

So what I'm intending to do here is to create a part of a script that can open a single or multiple torrents with µtorrent (through wine).

The Wine path needs to be appended to the arguments like so (the loop is obviously not working):

for i in "$@"; do
  open="Z:/$(pwd)/$i"
done

wine utorrent "$open"
Это было полезно?

Решение

I would use an array:

args=()
pwd=$(pwd)
for i; do
    args+=("z:/$pwd/$i")
done
wine utorrent "${args[@]}"

In a bash for loop, if you leave out the in ... clause, it iterates over "$@" by default.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top