Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have this cmds:

(youtube-dl | zenity --progress --width=400 --height=100 --title="Scaricamento" --text "Scaricamento in corso..." --auto-close --pulsate

But i have a problem: if i click on "abort" or i press the "x" button nothing can i exit the script and all the processes it has started?

This is the full script:


you_url=`zenity --entry --text "Inserisci URL Youtube" --title "URL"`
file=`youtube-dl --get-filename $you_url`
cd $down_path
(youtube-dl $you_url) | zenity --progress --width=400 --height=100 --title="Scaricamento" --text "Scaricamento in corso..." --auto-close --pulsate
song_name=`zenity --entry --text "Inserisci titolo canzone e autore" --title "Info canzone"`
(ffmpeg -i $down_path/$file $song_name.mp3 -ab 256k 2>&1) | zenity --progress --width=400 --height=100 --title="Conversione" --text "Conversione in corso..." --auto-close --pulsate
rm -f $down_path/$file
unset IFS
notify-send "Conversione terminata" "
Il file:
si trova nella cartella:
Ti amo piccola mia non dimenticarlo mai
exit 0
share|improve this question

Is it a script or a one-liner?

In a one-liner I would do something like

(youtube-dl & echo $! > /var/lock/ | zenity --progress --width=400 --height=100 --title="Scaricamento" --text "Scaricamento in corso..." --auto-close --pulsate; kill `cat /var/lock/`
share|improve this answer
It doesn't work :( – Paolo Oct 15 '11 at 8:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.