Tiny Core Extensions > TCE Talk

bash issues

(1/2) > >>

Jeff W:
I have installed bash.tcz and the bash-locale.tcz but I'm having issues running existing bash scripts.  It appears when I try to run them they continue to have problems interpreting for loops so I converted those to while loops and changed all of my

x++

to

x=`expr $x +1`

which seems to have solved those issues.  Other syntax issues keep popping up.  These bash scripts were working on DSL and I'm converting to TC for some functionality provided by the updated kernel (specifically ease of wireless USB support).  Other than installing the bash.tcz and bash-local.tcz would there be anything else necessary to support bash scripts within TC?  Bash is present in /bin and my path is valid in the script.  It just appears to me perhaps it's attempting to process using ash rather than bash.  Is there a symlink that needs to change?  I'm fairly novice at linux administration and know just about enough to be dangerous at this point.

danielibarnes:
Do you have a small example script which describes the issue you are having? I know the busybox /bin/sh is insufficient sometimes, and I execute "rm /bin/sh; ln -s ../usr/local/bin/bash /bin/sh" to address that.

Jeff W:

--- Quote from: danielibarnes on March 01, 2010, 09:55:38 AM ---I execute "rm /bin/sh; ln -s ../usr/local/bin/bash /bin/sh" to address that.

--- End quote ---
 

That seems to have done the trick.  Thank you sir.  Now I just need to work out all my other script dependencies and change file targets and it looks like I should be good.

Jason W:
I intentionally left /bin/sh alone as busybox ash instead of making it a bash symlink.  Putting the #!/bin/bash shebang will of course call up bash while /bin/sh calls ash.

I origionally had /bih/sh symlinked to /bin/bash, but opted for choice instead.  Though bash should be totally sh compliant.  I will ponder whether to symlink /bin/sh to /bin/bash to avoid confusion once bash has been installed.

maro:
IMHO a script with a '#!/bin/sh' shebang should not use any bash-isms at all.

So, I'd suggest NOT to link /bin/sh to /bin/bash

BTW, the bash.tcz extension appears to be a bit "confused" about the proper location of the .bashrc (and maybe also the bashrc) file. When doing 'tce-load -wi bash' one gets:
    cp: cannot stat '/usr/local/etc/.bashrc': No such file or directory
    chown: /home/tc/.bashrc: No such file or directory
It might be that the '.../tce.installed/bash' script needs just a careful review.

Navigation

[0] Message Index

[#] Next page

Go to full version