Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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 http://www.youtube.com/watch?v=HhoewflkQu0) | 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 happens...how can i exit the script and all the processes it has started?

This is the full script:

IFS=$'\n'
down_path=/home/$USER/Scaricati

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:
$song_name.mp3
si trova nella cartella:
/home/$USER/Scaricati
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 http://www.youtube.com/watch?v=HhoewflkQu0 & echo $! > /var/lock/y.pid) | zenity --progress --width=400 --height=100 --title="Scaricamento" --text "Scaricamento in corso..." --auto-close --pulsate; kill `cat /var/lock/y.pid`
share|improve this answer
    
It doesn't work :( – Paolo Oct 15 '11 at 8:25

Your Answer

 
discard

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.