Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 12-09-2004, 12:20 AM   #1
Senior Member
Registered: Nov 2001
Location: Budapest, Hungary
Distribution: SuSE 6.4-11.3, Dsl linux, FreeBSD 4.3-6.2, Mandrake 8.2, Redhat, UHU, Debian Etch
Posts: 1,126

Rep: Reputation: 58
Bash scripts are no longer portable?

I wrote a bash script that runs fine on a default SuSE 9.0 system (at home).
I took it to a default SuSE 9.1 system (at work), and the same script returned several syntax errors there.

It turned out that my code HAS CHANGED simply by having been taken to SuSE 9.1: all accented characters and the subsequent character have disappeared.
I think this is due to the fact that SuSE 9.1 is unicode-enabled by default.

However, it is a disaster, as it will destroy all of my scripts:

Lines like this are quite common in my scripts:
echo "Bet"

which will be changed to the following in SuSE 9.1:
echo "Bet

As you see, the same line lacks a quotation mark at the end in SuSE 9.1, and so the script will fail, or what is worse: the result is unpredictable, depending on the place where the change took place. In the most unfortunate case there are chances that a script working fine on SuSE 9.0 will do harm when run on SuSE 9.1.

I wonder what you think about this, and if there is a workaround?

Last edited by J_Szucs; 12-09-2004 at 12:22 AM.
Old 12-09-2004, 12:29 PM   #2
Registered: Jan 2004
Location: Southern California
Distribution: Slackware
Posts: 32

Rep: Reputation: 15

I'm guessing that the language variables on the SUSE at are different than the language variables on your home machine.

Here's and answer which came from this thread:

( post #4)

I got this from a Faq .

-o nls={NAME}

NTFS stores all file and directory names in Unicode which can represent any character from any language. By default the Linux NTFS driver converts the names to ASCII which is OK for some people, but no good if your languages includes letters like or .

NLS (Native Language Support) controls how characters are displayed. You can choose either utf8 which, like Unicode, can represent all characters, or your own codepage, e.g. iso8859-1 (Western Europe), iso8859-2 (Central Europe), gb2312 (Simplified Chinese), iso8859-8 (Hebrew). Below are some example mount commands:

mount /dev/hda1 /mnt/windows -t ntfs -r -o nls=utf8
mount /dev/hda1 /mnt/windows -t ntfs -r -o nls=iso8859-2
mount /dev/hda1 /mnt/windows -t ntfs -r -o nls=gb2312

Ignore the ntfs parts.Try searching for NLS and you might find a better answer.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
little help with bash scripts sniff Programming 2 10-26-2005 06:17 PM
bash scripts hoffmanyew Programming 3 08-11-2005 02:27 AM
Need Help With Bash Scripts the_woelf Linux - Software 4 06-30-2004 10:09 AM
$? in Bash scripts clinton Linux - Newbie 4 02-20-2004 12:15 PM
Bash scripts? BajaNick Programming 3 07-05-2003 11:13 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:40 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration