10

I would like to set the same value to the locale environment variables: LC_CTYPE, LC_ALL, LANG.

I want to be able to set it directly on the interactive bash shell, something like this:

$ export LC_CTYPE=$LANG=$LC_ALL=C

This answer Assign same value to multiple variables shows how to do it in a script, but not in the interactive shell.

1
  • 1
    The link you provided shows how to do it in a PHP script, not a shell. Commented Apr 3, 2014 at 7:26

2 Answers 2

18
export {LC_CTYPE,LANG,LC_ALL}=C
Sign up to request clarification or add additional context in comments.

1 Comment

Hi Soner, anyway to accomplish this in 'ksh'. Because, the syntax you provided is not supported by 'ksh'
5

The reference provided by you isn't a shell reference, it's a PHP example.

In shell, one way would be to use a loop:

for i in FOO BAR BAZ; do
  export $i=value
done

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.