Yusifx1
Yusifx1

Reputation: 101

How define output folder of curl while running script

I have command that executed when script over and download file from list. I use Termux on android and it say you can't use cd while running script.

    xargs -n 1 curl -O -C - <url

But it download all file to folder where I runned this script. How I can change output directory.

PS: Only curl please. Aria2c and wget will ignored by me.

Upvotes: 1

Views: 1488

Answers (1)

Yusifx1
Yusifx1

Reputation: 101

Okay. This script I use now

         while read url
        do
        curl --create-dirs -o "$file path/name" $url

I use "basename" of url for name. Please answer if you have better code.

Upvotes: 1

Related Questions