[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[MiNT] bash new version
Hello Guido.
I think ozk and I have spotted a bug in bash:
GNU bash, version 2.03.2(1)-release (m68k-atari-mint)
Interactively it seems to work very well.
When use in scripts, it seems it has problem with if [ (or if [[ )
It seems that within [ $var ] var never gets expanded correctly
As in:
if [[ -f /etc/rc.net ]]
This will return that it is a file. so correct.
But if:
outfile="/etc/rc.net"
echo $outfile (this DOES return correctly /etc/rc.net from the script)
if [[ -f $outfile ]]
This will always fail.
Note: Tried with all the standards, like:
if [ -f "$outfile" ]
if [[ -f $outfile ]]
if [[ -f "$outfile" ]]
if [[ -f ${outfile} ]]
if [ -f ${outfile} ]]
None work correctly.
Only way to get that working is to change the shell for the scripting.
#!/bin/ash (the old kgmd one) this will work.
Anyway, any idea, any clue?
Thanks.