Page 1 of 1

[Solved] Should this work?

Posted: Fri Feb 16, 2018 8:30 pm
by Mattyboy
First time trying this, no elegance, so bare with me.

Code: Select all

#!/bin/bash

mkdir ~/Desktop/files
nemo /mnt/freespace
xed ~/Desktop/template.txt
chromium-browser https://forums.linuxmint.com/
Just wanted to make a quick terminal shortcut to open the above to save time. Placed in /usr/bin and its seems to be working when I type command name into terminal, got that part right... however chromium will not open until after I close xed, rather annoying. ( I have tried /usr/bin/chromium-browser )

(Note: this isn't my exact set of command paths but for these purposes it demonstrates what it is I'm trying to do.)

Can't seem to find useful up to date info online to trouble shoot ... so... any ideas? Cheers.

Re: Should this work?

Posted: Fri Feb 16, 2018 9:14 pm
by Pilosopong Tasyo
Mattyboy wrote:
Fri Feb 16, 2018 8:30 pm
...however chromium will not open until after I close xed...
There are apps and tools that won't return control to the terminal or parent script until they finish running their course, or they get 'killed off' by an external action. You might want to use the & operator to force xed to run as a background process so the script execution proceeds without waiting.

xed ~/Desktop/template.txt &

Reference for further reading: https://www.tecmint.com/chaining-operat ... -examples/

Re: Should this work?

Posted: Fri Feb 16, 2018 9:39 pm
by Mattyboy
Pilosopong Tasyo wrote:
Fri Feb 16, 2018 9:14 pm
You might want to use the &
Yes thank you this did the trick. I had tried it earlier with && which didn't work so gave up on that idea... now realize the error of my ways :lol:

Appreciated

Solved.