Menu

Error installing on MacBook 1,1

2024-05-15
2024-05-20
  • therealsmudley

    therealsmudley - 2024-05-15

    Hello,
    When trying to install my MacBook 1,1 I get this error no matter what I do.

    /Volumes/NO NAME/refind-install: line 1397: conditional binary operator expected
    /Volumes/NO NAME/refind-install: line 1397: syntax error near `=~'
    /Volumes/NO NAME/refind-install: line 1397: `         if [[ "$FirstCmdlineOption" =~ (vmlinuz|bzImage|kernel) ]] ; then'
    

    I appreciate any help/ideas

     
  • joevt

    joevt - 2024-05-16

    What OS and OS version and shell version are you using?

    $SHELL --version
    
     
  • therealsmudley

    therealsmudley - 2024-05-16

    @joevt
    Thanks for the reply
    Productname: Max OS X
    Productversion: 10.4.11
    $SHELL /bin/bash

     
  • joevt

    joevt - 2024-05-16

    I think bash in Mac OS X 10.4.11 doesn't like =~ (vmlinuz|bzImage|kernel)
    You'll need a different comparison method there.

     
  • joevt

    joevt - 2024-05-16

    Maybe use perl?

    if perl -nE 'exit !(/vmlinuz|bzImage|kernel/)' <<< "$FirstCmdlineOption"; then
    
     

    Last edit: joevt 2024-05-16
    • therealsmudley

      therealsmudley - 2024-05-16

      @jovet
      I'm not new to programming, but I'm not fluent in any specific programming language.
      With that said, I would need more detailed instructions where to make edits in the original script.

      Regards,

      Paul Jurkonis

      Sent from Proton Mail mobile

      Regards,

      Paul Jurkonis

      Sent from Proton Mail mobile

      -------- Original Message --------
      On May 16, 2024, 8:09 AM, joevt wrote:

      Maybe use perl?

      if

      perl

      -

      nE

      'exit !(/vmlinuz|bzImage|kernel/)'

      <<<

      "$FirstCmdlineOption"

      ; then


      Error installing on MacBook 1,1


      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/refind/discussion/general/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

       
  • joevt

    joevt - 2024-05-17

    I haven't looked at the script, but I suspect you want to replace line 1397 with the line I provided.
    Then you may wish to search for any other occurrances of =~ to see if they also need to be changed.

    But before doing that, test the replacement to make sure it works with your shell version.

    testit () {
        if perl -nE 'exit !(/vmlinuz|bzImage|kernel/)' <<< "$FirstCmdlineOption"; then
            echo match
        else
            echo nomatch
        fi
    }
    FirstCmdlineOption=vmlinuz ; testit
    FirstCmdlineOption=bzImage ; testit
    FirstCmdlineOption=kernel ; testit
    FirstCmdlineOption=aaaavmlinuzaaaa ; testit
    FirstCmdlineOption=aaaabzImageaaaa ; testit
    FirstCmdlineOption=aaaakernelaaaaa ; testit
    FirstCmdlineOption=bbbbbb ; testit
    
     
  • therealsmudley

    therealsmudley - 2024-05-17

    @joevt
    this is what happens when I run in Bash and Perl

    **Bash:**
    
    PALMACPRO:~ myName$ /Users/ myName /Desktop/new  'Users/ myName /Desktop/new: line 1: syntax error near unexpected token `{ 'Users/ myName /Desktop/new: line 1: `testit () { PALMACPRO:~ myName $   
    
    **Perl:** 
    PALMACPRO:~/desktop myName $ perl -w new Unquoted string "perl" may clash with future reserved word at new line 2. String found where operator expected at new line 2, near "nE 'exit !(/vmlinuz|bzImage|kernel/)'"         (Do you need to predeclare nE?) syntax error at new line 1, near ") {" Unterminated <> operator at new line 2.
    
     
  • joevt

    joevt - 2024-05-18

    Correction: To work in Mac OS X 10.4.11 or 10.5.8, replace -nE with -ne.

    I have no idea how you got those errors. It's a bash script that uses perl so no reason to try it in perl. Just copy and paste it into Terminal.app.

    In Mac OS X 10.4.11, perl -v says I have v5.8.6

     
  • therealsmudley

    therealsmudley - 2024-05-19

    @joevt
    I made the change, -nE to -ne.
    I ran it through bash
    this is the error;

    /Users/myName/Desktop/new.bash: line 1: syntax error near unexpected token'`{ 
    'Users/myName/Desktop/new.bash: line 1: `testit () { 
    
     
  • joevt

    joevt - 2024-05-20

    Maybe you can show me how you are running it through bash.
    In my tests, I just copy and paste the text into a Terminal.app window.

     
    • therealsmudley

      therealsmudley - 2024-05-20

      Yes, that's exactly what I do.
      Copy and paste then press enter to execute.

      Regards,

      Paul Jurkonis

      Sent from Proton Mail mobile

      -------- Original Message --------
      On May 19, 2024, 7:58 PM, joevt wrote:

      Maybe you can show me how you are running it through bash.
      In my tests, I just copy and paste the text into a Terminal.app window.


      Error installing on MacBook 1,1


      Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/refind/discussion/general/

      To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

       
  • joevt

    joevt - 2024-05-20

    I'm using 10.4.11 on a PowerPC Mac but it should be the same as an Intel Mac.

    Here's the output when I paste the text (I removed the tabs to be safe):

    JoeG5:~ joevt$ echo $BASH_VERSION
    2.05b.0(1)-release
    JoeG5:~ joevt$ testit () {
    > if perl -ne 'exit !(/vmlinuz|bzImage|kernel/)' <<< "$FirstCmdlineOption"; then
    > echo match
    > else
    > echo nomatch
    > fi
    > }
    JoeG5:~ joevt$ FirstCmdlineOption=vmlinuz ; testit
    match
    JoeG5:~ joevt$ FirstCmdlineOption=bzImage ; testit
    match
    JoeG5:~ joevt$ FirstCmdlineOption=kernel ; testit
    match
    JoeG5:~ joevt$ FirstCmdlineOption=aaaavmlinuzaaaa ; testit
    match
    JoeG5:~ joevt$ FirstCmdlineOption=aaaabzImageaaaa ; testit
    match
    JoeG5:~ joevt$ FirstCmdlineOption=aaaakernelaaaaa ; testit
    match
    JoeG5:~ joevt$ FirstCmdlineOption=bbbbbb ; testit
    nomatch
    JoeG5:~ joevt$ 
    

    This is another method where I put the text into a file and used source to evaluate it:

    JoeG5:~ joevt$ source /Users/joevt/Documents/bashtest.txt 
    match
    match
    match
    match
    match
    match
    nomatch
    

    sh should give a similar result:

    JoeG5:~ joevt$ sh /Users/joevt/Documents/bashtest.txt 
    
     

    Last edit: joevt 2024-05-20

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.