Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am trying to utilize zenity in my simple ffmpeg-cut-mp3 script, but it hangs after the input into zenity :/ What's the matter with this?

#! /bin/bash

start=$(zenity --entry --title="CutMp3" --text="Start time ? (hh:mm:ss.ms)") &

duration=$(zenity --entry --title="CutMp3" --text="Duration in seconds ?") &

gnome-terminal -x ffmpeg -ss "$start" -t "$duration" -i "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" -acodec copy "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" &&

zenity --notification --text "File cut !"
share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

You should not be backgrounding the first two variable assignment lines with the & as you go along. You are executing gnome-terminal before the zenity processes have retrieved a value because they were lauched, then backgrounded, and the script moved on.

share|improve this answer
    
Ooooh ... that's it .. thank you very much :) –  tesseract Jun 20 '11 at 11:46
add comment

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.