[Solved] Should this work?

Forum rules
Before you post please read how to get help
Post Reply
Mattyboy
Level 6
Level 6
Posts: 1026
Joined: Thu Mar 26, 2015 2:17 pm

[Solved] Should this work?

Post by Mattyboy » Fri Feb 16, 2018 8:30 pm

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.
Last edited by Mattyboy on Fri Feb 16, 2018 9:40 pm, edited 1 time in total.

User avatar
Pilosopong Tasyo
Level 6
Level 6
Posts: 1436
Joined: Mon Jun 22, 2009 3:26 am
Location: Philippines

Re: Should this work?

Post by Pilosopong Tasyo » Fri Feb 16, 2018 9:14 pm

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/
Image
o Give a man a fish and he will eat for a day. Teach him how to fish and he will eat for a lifetime!
o If an issue has been fixed, please edit your first post and add the word [SOLVED].

Mattyboy
Level 6
Level 6
Posts: 1026
Joined: Thu Mar 26, 2015 2:17 pm

Re: Should this work?

Post by Mattyboy » Fri Feb 16, 2018 9:39 pm

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.

Post Reply

Return to “Scripts & Bash”