Mostly, I have found many scripts will work using ash.
I am using busybox 1.1.8.4-unicode (from Barry) and bash 4.2
Here's what we can do to make scripts faster...
If we open a shell script and change #!/bin/sh to #!/bin/ash, the script uses 'ash' not 'bash' to execute the code.
The 'ash' shell is part of busybox on most puppies, and smaller than bash, with less features.
Anyway... Ash is faster, but has some problems.
EDIT: A really easy way to check for 'Bashisms' in scripts: checkbashisms.pl!
Just download it, remove the.'gz' and make it executable
Then just 'checkbashisms /path/to/script' to check a script!
Older info continued below....
I learned that ash (supposedly) doesn't like
Code: Select all
[ ! "VAR" = "something" ]
Code: Select all
[ "$VAR" != "something" ]
Also, apparently, ash does not support
Code: Select all
${VARNAME%%cutmeofftheend}
Code: Select all
${VARNAME##cutmeoffthestart}
Another thing, this will not work in ash
Code: Select all
export VAR="some value"
Code: Select all
VAR="some value"; export VAR
Also, I think ash does not like:
Code: Select all
function my_function_name () {
Code: Select all
my_function_name () {
should make things faster, but use only if you don't depend on locales in the script.
Code: Select all
OLDLANG=$LANG
LANG=C
Code: Select all
LANG=$OLDLANG
1. Is it possible to execute a command defined in the main script, from within a GTK-Dialog button? If so, that would be great, but at the moment, anything like this in the GTKDialog GUI
Code: Select all
<button>
<action>my_function_name</action>
</button>
Code: Select all
my_function_name: command not found
2. Does anyone know anything else that needs to be done to make bash scripts work in ash?
Which other features are missing from ash?
EDIT: Arrays are missing. See 3rd post, below.