Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (3) </ [1] 2 3 >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: Embedding Commands, Like a DOS batch file< Next Oldest | Next Newest >
Aussie Offline





Group: Members
Posts: 17
Joined: Aug. 2005
Posted: Sep. 22 2005,15:13 QUOTE

Hi,
I am wondering if there is a way to execute commands from a file - as you do in DOS with a batch file?

For instance, the command "mydsl-load opt/snake.dsl" will do the same as going into emelfm, going to the dsl package and clicking Mydsl.

It would be nice to be able to embed this command into a submenu in the "Right click context menu" file for example.

Aussie
Back to top
Profile PM 
larkl Offline





Group: Members
Posts: 177
Joined: Sep. 2005
Posted: Sep. 22 2005,15:29 QUOTE

Have you tried something like a bash script?  This should be easy.  I'm sure that you could then make it run from an icon.  As far as embedding into a right-click menu, I don't have a clue.
Back to top
Profile PM 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: Sep. 22 2005,15:38 QUOTE

Yes....this is in my opinion the most fundamental feature of a GNU system.  The Bash shell is your base in DSL.  When you log in, you have a shell that opens other shells that open other shells, etc....and they can, for the most part, all be manipulated through bash.  Bash can be used interactively, as from a terminal prompt, and can also be used through a script (the equivalent of a batch file). The mydsl-load executable, and all other DSL-specific executables, are scripts...many of them Bash scripts. Check out the bash documentation at tldp.org for more info.

As far as "embedding" a command in the right-click menu, it should be very easy, depending on what application you are referring to.  In Fluxbox, the file is /home/dsl/.fluxbox/menu.  The syntax is [exec] (LABEL) {COMMAND}.  In Emelfm i think you have a gui interface for manipulating menus and commands.


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
Aussie Offline





Group: Members
Posts: 17
Joined: Aug. 2005
Posted: Sep. 22 2005,15:40 QUOTE

Hi Larkl,

Putting it into the menu I can do, it's the actual embedding of a command into a file (so it executes) that I don't know how to do.

I don't know what a bash script is yet.

Aussie
Back to top
Profile PM 
Aussie Offline





Group: Members
Posts: 17
Joined: Aug. 2005
Posted: Sep. 22 2005,15:49 QUOTE

Quote (mikshaw @ Sep. 22 2005,23:38)
As far as "embedding" a command in the right-click menu, it should be very easy, depending on what application you are referring to.  In Fluxbox, the file is /home/dsl/.fluxbox/menu.  The syntax is [exec] (LABEL) {COMMAND}.

Hi Mikshaw,

I tried putting the command straight into the menu file using the format you suggested, but it didn't execute. That's why I'm asking about "embedding" commands.

I tried other commands such as "touch" and they won't execute either.

I will have to read up on bash scripts tomorrow, sounds interesting  :)

Aussie
Back to top
Profile PM 
11 replies since Sep. 22 2005,15:13 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (3) </ [1] 2 3 >/
reply to topic new topic new poll
Quick Reply: Embedding Commands

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code