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 ...
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 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:
save this to the file ".kshrc", set the executable bit and excecute by ". ./.kshrc" to activate it.
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 ...
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...
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
at the end of the ".profile" script, just in case.
But except for this the two events are quite different.
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......
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)
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)
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)
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)
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)
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)
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)
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)