Forum Discussion

David_G__33241's avatar
David_G__33241
Icon for Nimbostratus rankNimbostratus
Nov 24, 2015

French characters in a BASH script

I have a script that needs to store French text in some variables such as “… d’accès à distance… ”. At the BASH prompt I can type tmp="d’accès à distance" and it works. I can echo $tmp and see the correct value. If I copy that exact line and past it into a BASH script it changes to tmp="d<92>accèà istance".

 

I found some information that talked about changing the character set to ISO8859-1 and/or changing my terminal type but my Linux knowledge is limited. Any help would be appreciated.

 

Thanks

 

1 Reply

  • I do not use accents in scripts or log files. All the time you will see weird symbols instead of your text depending on how copy the code (I like to copy from notepad++ directly into vi) or which editor you use, sometimes it will break the code syntax and will be harder to search patterns in your log files. If your are printing text to be shown in HTML pages, I would suggest for you to use HTML entities.