[SOLVED] Bash error displayed in console window
[SOLVED] Bash error displayed in console window
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?
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.
Re: Bash error displayed in console window
This is an error that is posted once every two months here on the forum.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?
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.
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?
-----------------------------------------------------------------------------------------------------------------
#!/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?
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*..
Not sure if Slacko has this but- one other thought.
And if you wouldn't mind, enclose your script in *code*..
Looks like a few syntax errors there. Replace yours with mine- make executable..
- Attachments
-
- libglib2.sh.gz
- (500 Bytes) Downloaded 317 times
Undo everything you've done and run:
EDIT: only one poster in this thread was on to it
Code: Select all
rm -f /etc/profile.d/*.csh
Puppy Linux Blog - contact me for access
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
Not use that scriptSylvander 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?
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
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.
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.
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
You want your environment variable G_FILENAME_ENCODING to have the value @locale. That is what your script wants to do.Sylvander wrote:L18L:
I don't understand the meaning of what you said.
I do not understand why because in puppy this variable is @locale
So why use the script ?
That is exactly what I am meaning, too.01micko wrote:Undo everything you've done
If the output of
Code: Select all
echo $G_FILENAME_ENCODING
@locale
then
Code: Select all
export G_FILENAME_ENCODING=@locale
1.
My answer: I've done this.
2. L18L said: If the output of
is not
@locale
My answer: It IS @locale.
L18L said: That is exactly what I am meaning, too.01micko wrote:Undo everything you've done
My answer: I've done this.
2. L18L said: If the output of
Code: Select all
echo $G_FILENAME_ENCODING
@locale
My answer: It IS @locale.
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
Re: Bash error displayed in console window
My idea is : do not run that script because you do not need it and there is nothing to fixSylvander wrote:Does anyone have any idea how to fix this?
Re: Bash error displayed in console window
Could you be specific?L18L wrote:My idea is : do not run that script because you do not need it and there is nothing to fix
Which script do I not run, and how do I make it not run?
In other words- take his advice. You don't need *any* csh files in /etc/profile.d..
- L18L
- Posts: 3479
- Joined: Sat 19 Jun 2010, 18:56
- Location: www.eussenheim.de/
Re: Bash error displayed in console window
That scriptSylvander wrote:Could you be specific?L18L wrote:My idea is : do not run that script because you do not need it and there is nothing to fix
Which script do I not run, and how do I make it not run?
To make it not run: Follow 01micko´s advice or delete that file.
Hope that helps
This fixed it.01micko wrote:Undo everything you've done and run:
Code: Select all
rm -f /etc/profile.d/*.csh
Thank you 01micko.
Thanks also to L18L and Semme.