PDA

View Full Version : New bash 3.1-1 from unstable causes remaster script to fail



tr
12-14-2005, 06:41 PM
Don't upgrade to bash version 3.1-1 because you can't use Fabian Franz's menu based scripts after that!

This is what you get:

root@Knoppix:~# knoppix-remaster /mnt/hda12/dvd-xorg-udev/
/usr/bin/knoppix-remaster: line 45: syntax error near unexpected token `('
/usr/bin/knoppix-remaster: line 45: ` let
REMASTER_PERC=($REMASTER_PROGRESS*100)/$REMASTER_NEEDED_SIZE'
root@Knoppix:~#

Stable and testing versions of bash works fine. If someone has this same problem, you can solve it by downgrading bash to stable or testing (no dependency problems).

-tapsa-

firnsy
12-16-2005, 04:05 AM
I haven't downloaded bash 3.1 but I always use "[]" brackets for my arithmetic.

Modify the line

REMASTER_PERC=($REMASTER_PROGRESS*100)/$REMASTER_NEEDED_SIZE

to read (functionally identical)

REMASTER_PERC=$[$REMASTER_PROGRESS*100/$REMASTER_NEEDED_SIZE]

and let me know if it helps.

tr
12-16-2005, 07:21 PM
Yes, it works! But then also line 66 must be changed similary to:


let REMASTER_NEEDED_SIZE=$[(df /cdrom /KNOPPIX | awk '{ N+=$3 } END { N+=(500000*0); print N }')*115)/100
REMASTER_HAVE_SIZE=$(df $REMASTER_CHOICE | awk '{ print $4 }' | tail -n1 ]


-tapsa-

firnsy
12-17-2005, 04:22 AM
Excellent ... I'm glad it worked. 8)

tr
12-31-2005, 12:55 PM
Still problems. Now everything else works but not making a new remaster:


tapsa@linux:~$ sudo knoppix-remaster /mnt/hda16/remaster/
/usr/bin/knoppix-remaster: line 67: bad substitution: no closing `)' in REMASTER_NEEDED_SIZE=$[(df /cdrom /KNOPPIX | awk '{ N+=$3 } END { N+=(500000*0); print N }')*115)/100
REMASTER_HAVE_SIZE=$(df $REMASTER_CHOICE | awk '{ print $4 }' | tail -n1 ]


Sorry, but I'm not a developer myself and don't know how to fix this. This error message comes with new bash, so it need to be corrected. Perhaps it's time to ask Fabian Franz to do a new updated remaster script.

-tapsa-

firnsy
01-01-2006, 01:25 AM
Still problems. Now everything else works but not making a new remaster:


tapsa@linux:~$ sudo knoppix-remaster /mnt/hda16/remaster/
/usr/bin/knoppix-remaster: line 67: bad substitution: no closing `)' in REMASTER_NEEDED_SIZE=$[(df /cdrom /KNOPPIX | awk '{ N+=$3 } END { N+=(500000*0); print N }')*115)/100
REMASTER_HAVE_SIZE=$(df $REMASTER_CHOICE | awk '{ print $4 }' | tail -n1 ]


Sorry, but I'm not a developer myself and don't know how to fix this. This error message comes with new bash, so it need to be corrected. Perhaps it's time to ask Fabian Franz to do a new updated remaster script.

-tapsa-

Believe it or not but from time to time returned error information is very accurate.

Since you haven't posted line numbers i'm guessin that this is line 67

REMASTER_HAVE_SIZE=$(df $REMASTER_CHOICE | awk '{ print $4 }' | tail -n1 ]
The error "bad substitution: no closing `)'" refers to the square bracket on the end it should be a closing parenthesis as shown below.

REMASTER_HAVE_SIZE=$(df $REMASTER_CHOICE | awk '{ print $4 }' | tail -n1 )

tr
01-01-2006, 12:27 PM
The error "bad substitution: no closing `)'" refers to the square bracket on the end it should be a closing parenthesis as shown below.

REMASTER_HAVE_SIZE=$(df $REMASTER_CHOICE | awk '{ print $4 }' | tail -n1 )

From the beginning there was problems with lines 45 and 66. Everything worked but making a new remaster. Now after changing line 67 as suggested I get error message of line 66.


Edited 3.1.2006
SOLVED :)

The thing to do is use bash extension in line 45 and 66:


let "REMASTER_PERC=($REMASTER_PROGRESS*100)/$REMASTER_NEEDED_SIZE"

let "REMASTER_NEEDED_SIZE=($(df /cdrom /KNOPPIX | awk '{ N+=$3 } END { N+=(500000*0); print N }')*115)/100"


Brackets $[<SENTENCE>] are oudated and will be removed in the future versions of bash.


-tapsa-

knopx4me
01-07-2006, 04:15 AM
I just removed the brackets in both lines and it worked fine.