Unable to save my configurationsettings


 
Thread Tools Search this Thread
Operating Systems AIX Unable to save my configurationsettings
# 1  
Old 10-30-2008
Unable to save my configurationsettings

I need to login to several AIX boxes .... I use putty for that and I am losing the configurations as I logout. For ex: I like to work with emacs editor, as AIX comes default with ksh , I set it using set -o emacs, once I log out and login back I am back again in ksh ... Smilie
# 2  
Old 10-30-2008
Put whatever you want to have set into the file .kshrc in your $HOME directory. This file (don't forget to set the executable-bit) is executed every time a new shell is started by your user.

Btw. and for clarification: when issuing "set -o emacs" you do NOT leave the Korn shell, just change the way the commandline can be edited.

I hope this helps.
# 3  
Old 10-30-2008
I dont have .kshrc file in my home dir , can I create it and check.

Nivas P
# 4  
Old 10-30-2008
Quote:
Originally Posted by nivaspIND
I dont have .kshrc file in my home dir
I am not sure if this is known to you (if it is: sorry about wasting your time), but you won't see files named starting with a dot "." if you do an "ls -l" as a non-root user. Use "ls -la" to see them. In fact this is what the "-a" option is for. For the root user "-a" is the default in ls.

You can create the file using your favourite text editor, it is like any other shell script.

Here is a sample .kshrc script which you can use as a starting point:

Code:
set -o vi             # my preference, change it to "emacs" if you like

unalias rm            # many systems have "rm" aliased to "rm -i" to enforce
                      # interactive use of rm, but i dislike this. I like living dangerously.

alias l='ls -lai'     # this is a nifty one, which saves typing

PS1='# '              # set the shell prompt

save this to the file ".kshrc", set the executable bit and excecute by ". ./.kshrc" to activate it.

I hope this helps.

bakunin
# 5  
Old 10-30-2008
Quote:
Originally Posted by nivaspIND
I need to login to several AIX boxes .... I use putty for that and I am losing the configurations as I logout. For ex: I like to work with emacs editor, as AIX comes default with ksh , I set it using set -o emacs, once I log out and login back I am back again in ksh ... Smilie
You can also use your .profile to set these configurations... also if you need to use a variable or update your path, etc... remember to export the variable...

For example add this to your .profile to add the bin directory from your home directory in your path...

Code:
export PATH=$PATH:~/bin

# 6  
Old 10-30-2008
Quote:
Originally Posted by sethcoop
You can also use your .profile to set these configurations...
ahem...:no - at least not quite

".profile" is executed every time the user logs on, whereas ".kshrc" is executed every time a new ksh instance starts. Of course, logging on will also start a new shell (which is started by the login process), so in this (but only in this) instance both events occur at the same time. It is a good idea to put

Code:
. ~/.kshrc

at the end of the ".profile" script, just in case.

But except for this the two events are quite different.

I hope this helps.

bakunin
# 7  
Old 10-31-2008
Thanks a lot Gurus (masters)... :-) , I really learnt a lot from this small topic once again thanks for sharing the info.

I have a quick question again ;-)

I have the following script in my $HOME :

alias l='ls -lai'
EDITOR=emacs # This is my fave editor
alias c='clear'
clear
alias x='exit'

when I type
$ oslevel -r command - I get the result but with the screen cleared
but when I use with sudo , I have no issues
$ sudo oslevel -r ....... i get the result at the next line......

anything wrong in the .kshrc profile
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Save value from output of Corestat and save in a list for each core

I am trying to modify the "corestat v1.1" code which is in Perl.The typical output of this code is below: Core Utilization CoreId %Usr %Sys %Total ------ ----- ----- ------ 5 4.91 0.01 4.92 6 0.06 ... (0 Replies)
Discussion started by: Zam_1234
0 Replies

2. UNIX for Dummies Questions & Answers

how to save changes to a file

is i want to sort or delete lines etc etc to a file, how do i save the changes. example i do sort file > file when i do cat file, all data is erased. thanks. (2 Replies)
Discussion started by: hobiwhenuknowme
2 Replies

3. Shell Programming and Scripting

Save cURL verbose output to file or do it like browser "save as.."

hi there ! i have exactly the same problem like this guy here https://www.unix.com/shell-programming-scripting/127668-getting-curl-output-verbose-file.html i am not able to save the curl verbose output.. the sollution in this thread (redirecting stderr to a file) does not work for me.... (0 Replies)
Discussion started by: crabmeat
0 Replies

4. UNIX for Advanced & Expert Users

Can't save a file

There is a file A.lcf. I am updating the file and saving it . But as soon as I am logging off and then logging in I am finding that the updated changes are not there in the file. (5 Replies)
Discussion started by: suchismitasuchi
5 Replies

5. UNIX for Dummies Questions & Answers

can't save crontab with vi

I edit crontab with vi editor, i delete the lines i wanted, but i can't save! i tried the :w, :wq, ZZ commands and it seems like vi is unfamiliar with it. any suggestions? (3 Replies)
Discussion started by: idan_cn
3 Replies

6. Shell Programming and Scripting

save

hi i would like someone to assist me to find out how i can Write a script called save which copies a file into a special directory, and another called recover which copies a file back out of the special directory. The user of the script should not be aware of the location of the special directory... (2 Replies)
Discussion started by: swainaina
2 Replies

7. UNIX for Dummies Questions & Answers

how to save files?

i just typed out a letter but want to hang on to it i typed it out in vi and was wondering how to save and exit from it? also how do you S&E from emacs since those are the two editors i mainly use any help would be appreciated (2 Replies)
Discussion started by: hiei
2 Replies

8. Programming

cannot save file...

Hello! I have a problem: I compile some function, which must save file: ===================== // prog.cpp void save_file(){ FILE *fs = fopen("file.txt", "w"); if(!fs) cerr<< "cannot save"; fprintf(fs, "This is a text file."); fclose(fs) } ===================== If i compile it from... (8 Replies)
Discussion started by: szzz
8 Replies

9. Shell Programming and Scripting

save me!

Hi! can anyone tell me how to save a file from command line? Any help appreciated. (2 Replies)
Discussion started by: hufs375
2 Replies
Login or Register to Ask a Question