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
 

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

reply to topic new topic new poll
Topic: Setting a variable on a .DSL file ?< Next Oldest | Next Newest >
christosvas Offline





Group: Members
Posts: 15
Joined: April 2004
Posted: July 01 2004,18:05 QUOTE

How do i set a system variable on a .DSL file with the "export" command that is needed before a program is run with the "myDSL" menu ?
Back to top
Profile PM 
roberts Offline





Group: Members
Posts: 4983
Joined: Oct. 2003
Posted: July 01 2004,19:32 QUOTE

That is called a shell wrapper. It is very common.
Say, for instance your app is call superapp. Then make a shell wrapper maybe call it start_superapp.sh

#!/bin/sh
export THE_APPS_REQUIRED_EXPORT_STUFF
export MORE_OF_THE_APPS_REQUIRED_EXPORT_STUFF
/path_to_the_real_app/superapp

For example:

#!/bin/sh
# This is a script to start the Edna MP3 server
#
export PYTHONPATH=/opt/python/bin
export PATH="$PATH:$PYTHONPATH"
cd /usr/share/edna
python edna.py
Back to top
Profile PM WEB 
christsvas
Unregistered






Posted: July 02 2004,07:21 QUOTE

thanks very much
Back to top
chaostic Offline





Group: Members
Posts: 328
Joined: Mar. 2005
Posted: Mar. 16 2005,05:48 QUOTE

Is there a way to create an interactive shell wrapper? One that allows a variable or two to be added to the final command? Like for a command line app, like streamripper (Which I added to the repository), which needs the http address to a streaming radio channel? The command to start it would be "streamripper http://xxx.xxx.xxx.xxx", where the user supplies the http:xxx.xxx.xxx.xxx. Or is a gui version avalible? Much like the MS Word Viewer in  version 1.0rc1 of DSL which requires input before it translates a page?
Back to top
Profile PM 
mikshaw Offline





Group: Members
Posts: 4856
Joined: July 2004
Posted: Mar. 16 2005,09:55 QUOTE

Anything is possible with Bash =o)
This is a very simple example:

echo "enter URL"
read URL
streamripper $URL

NOTE: using an interactive bash script launched from a menu or icon requires that the script be opened in an x terminal (rxvt -e streamripper_wrapper)


--------------
http://www.tldp.org/LDP/intro-linux/html/index.html
Back to top
Profile PM WEB 
4 replies since July 01 2004,18:05 < Next Oldest | Next Newest >

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

 
reply to topic new topic new poll
Quick Reply: Setting a variable on a .DSL file ?

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