Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.
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

1 Answer 1

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.