You are not logged in.

#1 2013-03-28 20:41:23

bjschuma
Member
From: Ann Arbor
Registered: 2009-03-10
Posts: 15

Bash error messages: backtick vs single quote

I'm running xfstests over NFS... the expected output for test 306 is:

touch: cannot touch `SCRATCH_MNT/this_should_fail': Read-only file system
                   ^^^

But I'm seeing:

touch: cannot touch 'SCRATCH_MNT/this_should_fail': Read-only file system
                   ^^^

The test is failing because my system is printing a single quote instead of a backtick before SCRATCH_MNT.  Is there an easy way to control this?

Offline

#2 2013-03-29 08:53:31

nowahn
Member
From: elsewhere
Registered: 2008-12-05
Posts: 75

Re: Bash error messages: backtick vs single quote

Hi,

What is your locale ?
Sometimes, the quote characters in the program's output depends on the current locale.
You should try some of these:

LC_ALL=C your-command
LC_ALL=en_US.UTF-8 your-command
…

For instance:

$ LC_ALL=C cp -v a b
'a' -> 'b'
$ LC_ALL=en_US.UTF-8 cp -v a b
‘a’ -> ‘b’
$ LC_ALL=fr_FR.UTF-8 cp -v a b
« a » -> « b »

Last edited by nowahn (2013-03-29 08:56:42)


take time to daydream, inspiration comes ...

Offline

#3 2013-03-29 14:45:02

bjschuma
Member
From: Ann Arbor
Registered: 2009-03-10
Posts: 15

Re: Bash error messages: backtick vs single quote

Thanks for the reply!  I'm using en_US for everything:

$ locale
LANG=en_US.UTF-8
LC_CTYPE=en_US.UTF-8
LC_NUMERIC=en_US.UTF-8
LC_TIME=en_US
LC_COLLATE=en_US.UTF-8
LC_MONETARY=en_US.UTF-8
LC_MESSAGES=en_US.UTF-8
LC_PAPER=en_US.UTF-8
LC_NAME=en_US.UTF-8
LC_ADDRESS=en_US.UTF-8
LC_TELEPHONE=en_US.UTF-8
LC_MEASUREMENT=en_US.UTF-8
LC_IDENTIFICATION=en_US.UTF-8
LC_ALL=

I tried with LC_ALL=C and it didn't change the output.

Offline

Board footer

Powered by FluxBB