Pergunta

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"
Foi útil?

Solução

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.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top