help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: line 50 : unexpected end of file - cant find the fault ..


From: Greg Wooledge
Subject: Re: line 50 : unexpected end of file - cant find the fault ..
Date: Fri, 16 Aug 2024 07:23:40 -0400

On Fri, Aug 16, 2024 at 12:26:42 +0200, alex xmb sw ratchev wrote:
> i was coding and now my script ( to run / log ollama ( open source ai sw )
> ) but i got error unexpected end of file , and i cant find the fault
> i searched for matching ' , " , { / } , $ , no luck ..
> it is 49 lines long
> 
> hope for fix ..

1) Show the actual error message.

2) Line 32 has 1-= where I believe you wanted 1= .

That said, I have absolutely no idea how your "${a[@]}" expansion
is supposed to work.  You're doing this:

hobbit:~$ unset -v a
hobbit:~$ a=(00=' echo ' 1d=' hello ')
hobbit:~$ declare -p a
declare -a a=([0]="00= echo " [1]="1d= hello ")
hobbit:~$ set -x
hobbit:~$ : "${a[@]}"
+ : '00= echo ' '1d= hello '

What in the HELL is that?

Wait... is the left-hand side (00 or 1d) supposed to be the name of an
alias that you're defining??

If you want to define two dozen aliases, why not just do this?

    alias \
        00=' stdbuf -i 0 -o 0 -e 0 -- ' \
        1d=' OLLAMA_DEBUG=0 ... ' \
        ...

Then people might actually have a CHANCE of understanding what the code
is doing.

For that matter, why are you defining a command named 00?

You know what... never mind that.  I don't think I want to know.  The
answer would just be even more confusing than this script-library-thing.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]