how to make bashscript a clickable one?

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
enhu
Posts: 302
Joined: Wed 27 May 2009, 02:13
Contact:

how to make bashscript a clickable one?

#1 Post by enhu »

is there a way?
i actually remember there is a way in puppy i just can't find it while searching. can you please lead me to the link.

goingnuts
Posts: 932
Joined: Sun 07 Dec 2008, 13:33
Contact:

#2 Post by goingnuts »

Think this works:

Code: Select all

[ "$DISPLAY" ] && [ "$(tty | grep not)" ]  && exec rxvt -e sh -c $0

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#3 Post by seaside »

Perhaps this ......

Code: Select all

#!/bin/bash
# clickable script

#figure out which line the script starts at
LINE=$(awk '/^START OF SCRIPT$/ { print NR + 1 }' $0)
# copy everything starting from $LINE to /tmp/myscript.sh
tail -n+$LINE $0 > /tmp/myscript.sh

# Run /tmp/myscript.sh
exec xterm -e bash /tmp/myscript.sh

START OF SCRIPT

--- your code  here ----
Cheers,
s

User avatar
DaveS
Posts: 3685
Joined: Thu 09 Oct 2008, 16:01
Location: UK

Re: how to make bashscript a clickable one?

#4 Post by DaveS »

enhu wrote:is there a way?
i actually remember there is a way in puppy i just can't find it while searching. can you please lead me to the link.
Right click on the file. From the pop-up, select 'properties' and in that dialogue, check the 'exec' boxes in the permissions section.
Spup Frugal HD and USB
Root forever!

Post Reply