[SOLVED] Bash error displayed in console window

Using applications, configuring, problems
Post Reply
Message
Author
Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

[SOLVED] Bash error displayed in console window

#1 Post by Sylvander »

Puppy = Slacko-5.3.3.1-SCSI
1. Here's what is displayed in the console:
bash: /etc/profile.d/libglib2.csh: line 28: syntax error: unexpected end of file

2. Here's what is displayed on line 26 of file /etc/profile.d/libglib2.csh:
setenv G_BROKEN_FILENAMES 1
Lines 27 & 28 are blank.

Does anyone have any idea how to fix this?
Last edited by Sylvander on Wed 08 Aug 2012, 18:57, edited 1 time in total.

User avatar
Keef
Posts: 987
Joined: Thu 20 Dec 2007, 22:12
Location: Staffordshire

#2 Post by Keef »

Try changing #!/bin/csh to #!/bin/csh -f

If it works, thank a search engine and
stackoverflow.

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

Re: Bash error displayed in console window

#3 Post by Karl Godt »

Sylvander wrote:Puppy = Slacko-5.3.3.1-SCSI
1. Here's what is displayed in the console:
bash: /etc/profile.d/libglib2.csh: line 28: syntax error: unexpected end of file

2. Here's what is displayed on line 26 of file /etc/profile.d/libglib2.csh:
setenv G_BROKEN_FILENAMES 1
Lines 27 & 28 are blank.

Does anyone have any idea how to fix this?
This is an error that is posted once every two months here on the forum.

You need to have csh installed to cope with csh syntax.

If the file has a normal #!/bin/sh interpreter as first line it would normally call /bin/bash in Puppy Linux.

The syntax of csh and bash is similar but many times incompatible.

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#4 Post by Sylvander »

Here's the code in the file:
-----------------------------------------------------------------------------------------------------------------
#!/bin/csh
#
# Description: This script sets the environment variables G_FILENAME_ENCODING
# and G_BROKEN_FILENAMES for the glib-2.0 library.
#
# G_FILENAME_ENCODING
# This environment variable can be set to a comma-separated list of
# character set names. GLib assumes that filenames are encoded in the
# first character set from that list rather than in UTF-8. The special
# token "@locale" can be used to specify the character set for the
# current locale.
#
# G_BROKEN_FILENAMES
# If this environment variable is set, GLib assumes that filenames are
# in the locale encoding rather than in UTF-8.

# If the LANG you have set contains any form of "UTF", we will guess you are
# using a UTF-8 locale. Hopefully we're correct.
echo $LANG | grep -iq UTF
if ($status == 0) then
setenv G_FILENAME_ENCODING "@locale"
endif

# It doesn't hurt to export this since G_FILENAME_ENCODING takes priority
# over G_BROKEN_FILENAMES:
setenv G_BROKEN_FILENAMES 1
empty line
empty line

---------------------------------------------------------------------------------------------------------------
.
This kind of thing is incomprehensible to me. :?
Any consensus on what I should do?

User avatar
Semme
Posts: 8399
Joined: Sun 07 Aug 2011, 20:07
Location: World_Hub

#5 Post by Semme »

Change the opening line to this: #!/bin/csh -f and save.. Refire!

If it doesn't work- install tcsh.

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#6 Post by Sylvander »

Did the 1st and saved the change to the file, but it made no difference.
Did the 2nd and saved the session changes and rebooted, but it made no difference.
Same error being displayed in the console window. :(

User avatar
Semme
Posts: 8399
Joined: Sun 07 Aug 2011, 20:07
Location: World_Hub

#7 Post by Semme »

Try that file with ONE empty line.

Not sure if Slacko has this but- one other thought.

And if you wouldn't mind, enclose your script in *code*..

User avatar
Semme
Posts: 8399
Joined: Sun 07 Aug 2011, 20:07
Location: World_Hub

#8 Post by Semme »

Looks like a few syntax errors there. Replace yours with mine- make executable..
Attachments
libglib2.sh.gz
(500 Bytes) Downloaded 317 times

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#9 Post by 01micko »

Undo everything you've done and run:

Code: Select all

rm -f /etc/profile.d/*.csh
EDIT: only one poster in this thread was on to it :wink:
Puppy Linux Blog - contact me for access

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

#10 Post by L18L »

Sylvander wrote: #!/bin/csh
#
# Description: This script sets the environment variables G_FILENAME_ENCODING
# and G_BROKEN_FILENAMES for the glib-2.0 library.
#

# It doesn't hurt to export this since G_FILENAME_ENCODING takes priority
# over G_BROKEN_FILENAMES:
setenv G_BROKEN_FILENAMES 1

Any consensus on what I should do?
Not use that script :lol:
G_FILENAME_ENCODING takes priority
and is already set:
/etc/profile wrote:#w003 no longer needed as woof now uses utf8...
#w004 no, leave in, have made utf8 optional...
##Sylpheed 2.0.1 requires this (also some other gtk2 apps)...
export G_FILENAME_ENCODING=@locale

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#11 Post by Sylvander »

I'm now confused. :?
Three different posters each giving seemingly different instructions on what to do.
Are all three instructions in conflict?
Or 3 different ways of achieving the same result?

01micko:
Your instruction is simple, and I believe I understand it.

Semme:
Your file [libglib2.sh] is not the one I've been working on [libglib2.csh].
Do you really intend this to be the file I should replace?

L18L:
I don't understand the meaning of what you said.

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

#12 Post by L18L »

Sylvander wrote:L18L:
I don't understand the meaning of what you said.
You want your environment variable G_FILENAME_ENCODING to have the value @locale. That is what your script wants to do.

I do not understand why because in puppy this variable is @locale
So why use the script ?
01micko wrote:Undo everything you've done
That is exactly what I am meaning, too.

If the output of

Code: Select all

echo $G_FILENAME_ENCODING
is not
@locale
then

Code: Select all

export G_FILENAME_ENCODING=@locale
will set it.

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#13 Post by Sylvander »

1.
01micko wrote:Undo everything you've done
L18L said: That is exactly what I am meaning, too.
My answer: I've done this.

2. L18L said: If the output of

Code: Select all

echo $G_FILENAME_ENCODING
is not
@locale
My answer: It IS @locale.

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Re: Bash error displayed in console window

#14 Post by L18L »

Sylvander wrote:Does anyone have any idea how to fix this?
My idea is : do not run that script because you do not need it and there is nothing to fix :lol:

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

Re: Bash error displayed in console window

#15 Post by Sylvander »

L18L wrote:My idea is : do not run that script because you do not need it and there is nothing to fix :lol:
Could you be specific?
Which script do I not run, and how do I make it not run?

User avatar
Semme
Posts: 8399
Joined: Sun 07 Aug 2011, 20:07
Location: World_Hub

#16 Post by Semme »

In other words- take his advice. You don't need *any* csh files in /etc/profile.d..

User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Re: Bash error displayed in console window

#17 Post by L18L »

Sylvander wrote:
L18L wrote:My idea is : do not run that script because you do not need it and there is nothing to fix :lol:
Could you be specific?
Which script do I not run, and how do I make it not run?
That script

To make it not run: Follow 01micko´s advice or delete that file.

Hope that helps

Sylvander
Posts: 4416
Joined: Mon 15 Dec 2008, 11:06
Location: West Lothian, Scotland, UK

#18 Post by Sylvander »

01micko wrote:Undo everything you've done and run:

Code: Select all

rm -f /etc/profile.d/*.csh
This fixed it. :D
Thank you 01micko. 8)

Thanks also to L18L and Semme. :D

Post Reply