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
copied='cp -v *SNAPSHOT.jar /home/user/folder'

prints information about copied files


gdialog --title "done" --clear --yesno "done $copied" 15 60

shows command that was executed, so it shows

done cp -v *SNAPSHOT.jar /home/user/folder

How to make gdialog show information about copied files ?

share|improve this question
up vote 2 down vote accepted

When you write

copied='cp -v *SNAPSHOT.jar /home/user/folder'

this is only a variable assignment, the command is executed when you write


that is equivalent to

cp -v *SNAPSHOT.jar /home/user/folder

If you want to capture the output of the command you should do

output=$(cp -v *SNAPSHOT.jar /home/user/folder)

this execute the cp command and put the stdout of the command in the variable output. Then you can use this variable to show the message in gdialog:

gdialog --title "done" --clear --yesno "done $output" 15 60
share|improve this answer
this also can be done by using ` instead of ' – UAdapter Oct 19 '11 at 7:34

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.