[Solved] Should this work?

About writing shell scripts and making the most of your shell
Forum rules
Topics in this forum are automatically closed 6 months after creation.
Locked
Mattyboy

[Solved] Should this work?

Post 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.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
Pilosopong Tasyo
Level 6
Level 6
Posts: 1432
Joined: Mon Jun 22, 2009 3:26 am
Location: Philippines

Re: Should this work?

Post 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/
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

Re: Should this work?

Post 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.
Locked

Return to “Scripts & Bash”