You are not logged in.
I have an arduino and I want to modify the launching script so that it will allow me to open sketches with "arduino test.pde" instead of a blank sketch. If you don't know what I am talking about don't worry, you don't need to know about an arduino
Here is the script:
#!/bin/sh
echo "$1"
APPDIR="$(dirname -- $(readlink -f -- "${0}") )"
cd $APPDIR
for LIB in \
java/lib/rt.jar \
java/lib/tools.jar \
lib/*.jar \
;
do
CLASSPATH="${CLASSPATH}:${LIB}"
done
export CLASSPATH
LD_LIBRARY_PATH=`pwd`/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
export LD_LIBRARY_PATH
export PATH="${APPDIR}/java/bin:${PATH}"
java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel processing.app.Base $1
If I replace the $1 in the last line with something like /home/phil/test.pde then it opens up fine and does what I want (but only works for 1 file).
Unfortunately the script is not accepting the parameter correctly for some reason. The echo "$1" in the second line does not echo anything back thus the last line doesn't open the script.
For example if I type "arduino lol" a blank line is echoed back.
Offline
~ $ cat /tmp/test
#!/bin/sh
echo "$1"
~ $ /tmp/test test
test
You must be doing something different....
Is there another `arduino` in your PATH?
Last edited by fukawi2 (2011-05-30 06:24:20)
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
nope. the "arduino" in /usr/bin points to the script I pasted in post 1 which is located in /usr/share/ardiuno/arduino
I am confused because I previously did something similar to you and it didn't work
Offline
nope. the "arduino" in /usr/bin points to the script I pasted in post 1 which is located in /usr/share/ardiuno/arduino
Have you confirmed that that is what is being executed though?
which arduino
Edit: or tried running it with the full path?
Last edited by fukawi2 (2011-05-30 11:31:58)
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
Dethredic wrote:nope. the "arduino" in /usr/bin points to the script I pasted in post 1 which is located in /usr/share/ardiuno/arduino
Have you confirmed that that is what is being executed though?
which arduino
Edit: or tried running it with the full path?
I have confirmed that the script is being executed because when I edited the last line of the script to:
java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel processing.app.Base /home/phil/test/test.pde
it opens the correct file.
That being said I just thought of something. The parameter that I am passing is going to /usr/bin/arduino, and that could not be passing it along to /usr/share/arduino/arduino
I am at work so I can't test this, but it seems logical. Will report back tonight. Thanks for the ideas.
Offline
Offline