run a script in MATE

The place to post if you need help or advice

Moderators: ChriThor, LXF moderators

run a script in MATE

Postby guy » Wed Jul 20, 2016 9:05 am

Using the MATE desktop on debian Jesse. I'd like to be able to launch an arbitrary script from the file browser (caja), for example via right-click > Run, but I can find no such option and have to resort to bash. Is there a way to do this?
"We don't need no frikkin' aliens, we c'n do this ourselves!" — anon.
guy
LXF regular
 
Posts: 1323
Joined: Thu Apr 07, 2005 12:07 pm
Location: Worcestershire

Re: run a script in MATE

Postby nelz » Wed Jul 20, 2016 1:16 pm

Is the script executable and does it have a shebang line? If so, a double-click should run it.
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)
User avatar
nelz
Site admin
 
Posts: 9038
Joined: Mon Apr 04, 2005 11:52 am
Location: Warrington, UK

Re: run a script in MATE (solved)

Postby guy » Wed Jul 20, 2016 5:00 pm

Ah, I added the
Code: Select all
#!/bin/bash
bit and now double-clicking brings up an options dialog - with run option :)
Many thanks.

Oddly though, when I select the Display option it fires up the GDebi package installer. Same if I do right-click > Open - I have to right-click > Open with > pluma.

Also, while I'm here: here it is in full:
Code: Select all
#!/bin/bash
# makepub version 0.0.0   20 Jul 2016
#
# Builds an ePub e-book from a prepared xml source file tree
#
# Before running, edit the output file path/name below to suit
NAME=new

# creates archive containing mimetype, uncompressed
zip -X0 $NAME.epub mimetype

# adds the rest, compressed
zip -X9Dr $NAME.epub META-INF OEBPS
"We don't need no frikkin' aliens, we c'n do this ourselves!" — anon.
guy
LXF regular
 
Posts: 1323
Joined: Thu Apr 07, 2005 12:07 pm
Location: Worcestershire

Re: run a script in MATE

Postby dtuxcomp » Wed Jan 25, 2017 8:42 pm

Try making sure the script is executable.
From a terminal cd to the directory where the script is
chmod +x Scriptname.sh

If this doesn't work try removing the .sh extension in case that works.
I use a lot of scripts that I can just double click on to run, using Dolphin / Thunar etc. and this works even when double clicking on a link.

D.
dtuxcomp
 
Posts: 7
Joined: Mon Jan 23, 2017 9:29 pm


Return to Help!

Who is online

Users browsing this forum: No registered users and 6 guests