Setting a variable on a .DSL file ?


Forum: myDSL Extensions (deprecated)
Topic: Setting a variable on a .DSL file ?
started by: christosvas

Posted by christosvas on July 01 2004,18:05
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 ?
Posted by roberts on July 01 2004,19:32
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

Posted by christsvas on July 02 2004,07:21
thanks very much
Posted by chaostic on Mar. 16 2005,05:48
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?
Posted by mikshaw on Mar. 16 2005,09:55
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)

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.