Equivalent command for setlocal in Unix


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Equivalent command for setlocal in Unix
# 1  
Old 05-02-2007
MySQL Equivalent command for setlocal in Unix

Hi all,
Is there any command in unix equivalent to setlocal in windows.
setlocal command is really useful in restoring local environment variables in windows.
Thanks,
Sonal.
# 2  
Old 05-02-2007
"man setlocale"
# 3  
Old 05-02-2007
But this is some kind of c library function. I want to use this in shell script.
# 4  
Old 05-02-2007
Code:
export LC_ALL=POSIX

resets all of the locale settings to POSIX. The default setting is usually POSIX or C

locale settings are controlled by changing the set of locale envrionment variables:
Code:
LC_CTYPE="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_MESSAGES="C"

# 5  
Old 05-02-2007
modifying variable ( locale ) LANG

controls other locale variables as well
# 6  
Old 05-02-2007
Looking at the Microsoft documentation

Setlocal creates a local scope and endlocal terminates the local scope. Any changes made within the setlocal and endlocal scope are discarded, thereby leaving the original environment unchanged. You can nest these two commands to a maximum of 32 levels. For more information about the setlocal and endlocal commands, see Setlocal and Endlocal

I think the closest equivalent effect can be created by spawning a subshell using ( ... ).
Code:
$ cat a.sh
A=OUTER
echo $A
(
A=INNER
echo $A
)
echo $A
$ ksh a.sh
OUTER
INNER
OUTER

# 7  
Old 05-17-2007
In unix where the locale variables are defined.

How the LC_ALL is being referred.

Plz throw light on this.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need Linux equivalent for UNIX

I have a folder called "log" which has a few sub-folders say "fda" "fd7" "fdd" "fd6 .... " I wish to fire the below command inside each subfolder starting with the folder with the latest time stamp. grep "$greptime.*exit" Prod.$(hostname).log | grep $fdrdate_new If the seach did not yield... (3 Replies)
Discussion started by: mohtashims
3 Replies

2. Windows & DOS: Issues & Discussions

DOS Equivalent of UNIX Command

Hi, The title of this post is a little vague but I couldn't think of what to call it. In Unix you can perform the following command ftp -v IPADDRESS <<END put FILE END In a DOS command prompt, is it possible to do the same kind of thing that the "<<END" does? So for example, ... (4 Replies)
Discussion started by: Ste_Moore01
4 Replies

3. AIX

smitty equivalent command line command

i know after you do something in smitty via the gui, you can click something in smitty that will show you how to do the same thing via the command line, (not using the gui) can anyone tell me how (2 Replies)
Discussion started by: asyed123
2 Replies

4. Shell Programming and Scripting

PHP Equivalent of the unix command

Hi Can any one please let me know which will be the PHP equivalent of the below Unix statement, curl -H "Content-type: application/json" -H "Accept: application/json" --data-binary '{"text" : "how to check the temperature?"}' -H "X-JaskUid:111" -X POST "www.google.com/res"'Thanks in advance!! ... (0 Replies)
Discussion started by: vidhyaS
0 Replies

5. Windows & DOS: Issues & Discussions

dos/intel unix command equivalent

In Unix I can use command line to do a find for files older than so many days and remove them. I can also capture the date to see if its a saturday and do something different. Are there any dos/intel command line equivalent commands to do this on a windows 2003 server? This is from an... (6 Replies)
Discussion started by: MizzGail
6 Replies

6. Shell Programming and Scripting

Windows command shell equivalent in Unix

In Windows we use cmd.exe \c as the command SHell What is its equivalent in UNIX ? Thanx for all your help. (10 Replies)
Discussion started by: simonsimon
10 Replies

7. UNIX for Dummies Questions & Answers

Equivalent of Substr in Unix

Hi, I have a shell variable which has a value 123456:abcdeg. I want to extract the value which is present before ":". Is there any command in Unix through which I can achieve this. Please suggest. Thanks, Saurabh (7 Replies)
Discussion started by: saurabhsinha23
7 Replies

8. Programming

IsDBCSLeadByteEx equivalent for unix

I am using IsDBCSLeadByteEx for windows, i would like to know whether there is any equivalent function in unix(linux) platform. (2 Replies)
Discussion started by: anjan_kumar_k
2 Replies

9. UNIX for Advanced & Expert Users

IsDBCSLeadByteEx equivalent for unix

I am using IsDBCSLeadByteEx for windows, i would like to know whether there is any equivalent function in unix(linux) platform. (1 Reply)
Discussion started by: anjan_kumar_k
1 Replies

10. UNIX for Dummies Questions & Answers

Equivalent unix command to minimize/maximize xterm window

To all experts, I need some advice on how I can enter a unix command which is equivalent to the action of minimizing/maximizing an active xterm window. How can I do this (i) when control is in the active xterm window to be minimized/maximized , & (ii) when control is in a xterm window which runs... (0 Replies)
Discussion started by: icemocha75
0 Replies
Login or Register to Ask a Question