Results 1 to 8 of 8

Thread: New bash 3.1-1 from unstable causes remaster script to fail

  1. #1
    Senior Member registered user
    Join Date
    Apr 2004
    Location
    Finland
    Posts
    272

    New bash 3.1-1 from unstable causes remaster script to fail

    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:
    Code:
    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-

  2. #2
    Member registered user
    Join Date
    Mar 2005
    Posts
    87
    I haven't downloaded bash 3.1 but I always use "[]" brackets for my arithmetic.

    Modify the line
    Code:
    REMASTER_PERC=($REMASTER_PROGRESS*100)/$REMASTER_NEEDED_SIZE
    to read (functionally identical)
    Code:
    REMASTER_PERC=$[$REMASTER_PROGRESS*100/$REMASTER_NEEDED_SIZE]
    and let me know if it helps.

  3. #3
    Senior Member registered user
    Join Date
    Apr 2004
    Location
    Finland
    Posts
    272
    Yes, it works! But then also line 66 must be changed similary to:
    Code:
    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-

  4. #4
    Member registered user
    Join Date
    Mar 2005
    Posts
    87
    Excellent ... I'm glad it worked.

  5. #5
    Senior Member registered user
    Join Date
    Apr 2004
    Location
    Finland
    Posts
    272
    Still problems. Now everything else works but not making a new remaster:
    Code:
    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-

  6. #6
    Member registered user
    Join Date
    Mar 2005
    Posts
    87
    Quote Originally Posted by tr
    Still problems. Now everything else works but not making a new remaster:
    Code:
    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 )

  7. #7
    Senior Member registered user
    Join Date
    Apr 2004
    Location
    Finland
    Posts
    272
    Quote Originally Posted by firnsy
    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:
    Code:
    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-

  8. #8
    Senior Member registered user
    Join Date
    Mar 2005
    Posts
    103
    I just removed the brackets in both lines and it worked fine.

Similar Threads

  1. Modified Remaster Script
    By JimmyJazz in forum Customising & Remastering
    Replies: 2
    Last Post: 07-04-2006, 05:40 PM
  2. remaster (klaus script) failed.
    By dmizer in forum Customising & Remastering
    Replies: 0
    Last Post: 02-28-2006, 03:30 PM
  3. Adding a bash script to you starting up list
    By ska_p_te in forum Customising & Remastering
    Replies: 3
    Last Post: 10-29-2004, 09:03 PM
  4. Replies: 0
    Last Post: 10-09-2004, 08:02 PM
  5. Please help with a BASH script!!! PLEASE READ
    By bizarro in forum General Support
    Replies: 7
    Last Post: 10-09-2004, 07:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Lenovo ThinkPad L13 Yoga Touch Laptop 13.3” Core i5 8GB RAM 256GB SSD Win 11 Pro picture

Lenovo ThinkPad L13 Yoga Touch Laptop 13.3” Core i5 8GB RAM 256GB SSD Win 11 Pro

$239.99



Lenovo ThinkPad L15 Gen 3 15.6

Lenovo ThinkPad L15 Gen 3 15.6" 16GB, Thunder Black

$241.50



Lenovo ThinkPad E14 Gen 2 Laptop 14” HD Ryzen 5 16GB RAM 512GB SSD Win 11 Pro picture

Lenovo ThinkPad E14 Gen 2 Laptop 14” HD Ryzen 5 16GB RAM 512GB SSD Win 11 Pro

$334.99



Lenovo ThinkPad E14 Gen 3 Laptop 14” FHD AMD Ryzen 5 16GB RAM 512GB SSD Win 11 picture

Lenovo ThinkPad E14 Gen 3 Laptop 14” FHD AMD Ryzen 5 16GB RAM 512GB SSD Win 11

$374.99



Lenovo Legion 5 Gaming 15.1

Lenovo Legion 5 Gaming 15.1" WQXGA OLED 165Hz Core i9-14900HX 16GB 1TB RTX 5070

$1469.00



LENOVO THINKPAD T14 GEN 2i  CORE I7-11165G7 2.8GHZ 16GB 256 SSD WCAM WI1 CORD picture

LENOVO THINKPAD T14 GEN 2i CORE I7-11165G7 2.8GHZ 16GB 256 SSD WCAM WI1 CORD

$245.00



Lenovo ThinkPad T14 Gen 1 14

Lenovo ThinkPad T14 Gen 1 14" AMD Ryzen 5 16GB 256GB SSD

$219.99



Lenovo - IdeaPad Slim 3i 15.3

Lenovo - IdeaPad Slim 3i 15.3" 2K Touchscreen Laptop - Intel Core 7 350 2026 ...

$679.99



Lenovo ThinkPad T14 Gen 1 | i5-10310U | 16GB RAM | NO DRIVE | NO OS | 89% BATT picture

Lenovo ThinkPad T14 Gen 1 | i5-10310U | 16GB RAM | NO DRIVE | NO OS | 89% BATT

$140.00



Lenovo ThinkPad T14s Laptop 14” Laptop Core i5 8GB RAM 256GB SSD Windows 11 Pro picture

Lenovo ThinkPad T14s Laptop 14” Laptop Core i5 8GB RAM 256GB SSD Windows 11 Pro

$249.99