![컬 -o에 대한 wget 관용구는 무엇입니까?](https://linux55.com/image/20802/%EC%BB%AC%20-o%EC%97%90%20%EB%8C%80%ED%95%9C%20wget%20%EA%B4%80%EC%9A%A9%EA%B5%AC%EB%8A%94%20%EB%AC%B4%EC%97%87%EC%9E%85%EB%8B%88%EA%B9%8C%3F.png)
그래서 나는 다음과 같은 일부 기능에서 코드를 사용합니다.
if [ ! -e $DOWNLOADS/$1 ]; then
echo_run curl -L http://$4/$5/$1 -o $DOWNLOADS/$1
fi
컬 없이 동일한 목표를 달성하는 방법이 궁금합니다.
답변1
딕시트 man wget
:
-O file
--output-document=file
The documents will not be written to the appropriate files, but all will be concatenated together
and written to file. If - is used as file, documents will be printed to standard output,
disabling link conversion. (Use ./- to print to a file literally named -.)
Use of -O is not intended to mean simply "use the name file instead of the one in the URL;"
rather, it is analogous to shell redirection: wget -O file http://foo is intended to work like
wget -O - http://foo > file; file will be truncated immediately, and all downloaded content will
be written there.