Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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 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
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

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.