bash에서 이러한 추가 출력 라인은 무엇입니까?


9

명령을 실행 한 후 (임의로) 다음 행을 볼 수 있습니다.

[1]-  Done                    wget -c http://downloads.sourceforge.net/project/zorin-os/9/zorin-os-9-core-32.iso?r=http%3A%2F%2Fzorinos.com%2Fdownload9.html
[2]+  Done                    ts=1460659842

첫 번째 줄은 명령 자체이며 항상 일어나는 것은 아닙니다. 그러나 때때로 명령 줄 앱은 Enter 키를 누를 때까지 명령 줄로 돌아 가지 않고 중지됩니다. 이 라인을 보여줍니다.

일주일 전까지 내 시스템은 이와 같이 작동하지 않았습니다. 이것이 문제입니까?

답변:


20

다음과 같은 명령을 실행했을 것입니다.

wget -c http://downloads.sourceforge.net/project/zorin-os/9/zorin-os-9-core-32.iso?r=http%3A%2F%2Fzorinos.com%2Fdownload9.html&ts=1460659842&something-else

이 명령에는 여러 문자를 동시에 실행하는& 데 사용되는 특수 문자가 포함되어 있습니다 . 이 명령은 세 개 이상의 명령으로 해석됩니다.

# First command (the one that you see after [1]):
wget -c http://downloads.sourceforge.net/project/zorin-os/9/zorin-os-9-core-32.iso?r=http%3A%2F%2Fzorinos.com%2Fdownload9.html
# Second command (the one that you see after [2]):
ts=1460659842
# Third command (the one which output should be above the "Done" lines):
something-else

다음은 더 잘 이해하는 데 도움이되는 예입니다.

# Here I'm launching three 'echo' commands, the first two in background, the third in foreground
andrea@andrea-laptop:~$ echo first & echo second & echo third
[1] 5033    # This is bash telling me that the first process was started with job number 1 and PID 5033
first       # This is the output from the first process
[2] 5034    # This is bash telling me that the second process was started with job number 2 and PID 5034
third       # This is the output from the third process
second      # This is the output from the second process
andrea@andrea-laptop:~$ 
[1]-  Done                    echo first    # This is bash telling me that the first background job has quit
[2]+  Done                    echo second   # This is bash telling me that the second background job has quit

이것과 다른 불쾌한 영향을 피하려면 URL을 올바르게 인용해야합니다.

wget -c 'http://downloads.sourceforge.net/project/zorin-os/9/zorin-os-9-core-32.iso?r=http%3A%2F%2Fzorinos.com%2Fdownload9.html&ts=1460659842&something-else'

6
터미널 명령을 맹목적으로 복사 해서는 안되는 또 다른 이유는 ... 누군가 URL을 someurl.com/index.php&malicious-command-here로 만들면 사람들은 그것을 실행하고 시스템을 손상시킬 수 있습니다.
Nzall
당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.