Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Currently I'm using Ubuntu with my system locale and language set to Japanese. However I'd like to have it always displaying gcc messages in English as it would be easier for me.

I found here if I did ~$ LC_MESSAGES=C gcc it displays in English. How can I make it so it's always like this without entering in ~$ LC_MESSAGES=C gcc every time and without changing my system language? All I want changed is "gcc".

share|improve this question
add comment

migrated from stackoverflow.com Oct 12 '12 at 4:34

This question came from our site for professional and enthusiast programmers.

3 Answers

up vote 2 down vote accepted

Create an alias in your shell.

alias gcc="LC_MESSAGES=C \gcc"
share|improve this answer
    
That was easy! Thank you. –  きりcut Oct 11 '12 at 23:03
add comment

The trouble with an alias will be that they don't transfer to things like make very reliably. If I needed to do it, I'd probably create a shell script called gcc in my $HOME/bin directory which would set the environment variable and execute the 'real' gcc. My own bin directory is always on my PATH ahead of system directories. Hence:

LC_MESSAGES=C exec /usr/gcc/v4.7.1/bin/gcc "$@"
share|improve this answer
add comment

Try setting LC_MESSAGES=C in your users ~/.profile

export LC_MESSAGES=C

EDIT Yeah don't use that it will change LC_MESSAES locale for all applications under your user that use it. Credit to Ignacio Vazquez-Abrams

share|improve this answer
    
"... and without changing my system language?" –  Ignacio Vazquez-Abrams Oct 11 '12 at 23:47
    
@Ignacio Vazquez-Abrams ...yeah you're right. It will affect more then just gcc messages for this user. However it doesn't change the overall systems language. –  iddqd Oct 12 '12 at 2:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.