Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to double click on a file that does this:

#!/bin/bash 
#Mount USB Jump, Copy files to it, Unmount it.
[open terminal (so that I can see what 's going on)]
pmount /dev/sdc JUMP
sleep 2s
cp -p -u source/path/ destination/path/
read -p "Press enter to unmount Jump or ctrl c to abort."
pumount /dev/sdc
[close terminal]

The two lines I don't know how to write are [open terminal] and [close terminal] Anyone knows how to do this?

Edit: Many thanks folks, I bundled your input together and eventually got there.

I double-click on the .sh file that says: 'terminal -hold -e /path/to/JumpBkp.sh' and it opens a terminal and gives me the whole rundown onscreen.

It was cool to receive so much input in so little time. Many thanks again.

2nd Edit: I've come up with an option that makes it even sweeter. I post it in case anyone bumps into this thread.

terminal -hold -e bash '/path/to/JumpBkp.sh'

The 'bash' spares me of that darn: "Warning: Could not find '/path/to/file.sh', starting '/bin/bash' instead. Please check your profile settings."

Cheerio!

share|improve this question

1 Answer 1

gnome-terminal -e command

or

terminal -e command

See Here for details: How can I make a script that opens terminal windows and executes commands in them?

Also of interest: How do I run executable bash scripts in Nautilus?

And some creativity with passing multiple commands: Passing multiple commands to gnome-terminal from a script

share|improve this answer

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.