Weird error with non-ASCII character in CSH

104 views Asked by At

What is so special about the character "à" (a accent-grave) that makes the following assignement in CSH fail:

#!/bin/csh -f

set title = `echo 'à'`
echo $title

It does NOT fail for any other character like: á, é, í, ó, ú, à, è, ì, ò, ù .... that I know of.

For example:

#!/bin/csh -f

set title = `echo 'áéíóúèìòù'`
echo $title

works as expected.

1

There are 1 answers

2
Nocturnal Compiler On

firstly, there is nothing special about the character of "à" it is a standard unicode character like the others you mentioned, chances are the problem persists with your version of shell or the way the locale settings are configured

but if you're looking to fix the issue try this code which displays the same character through the octal representation

#!/bin/csh -f

set title = `echo '\205'`
echo $title