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.

Dear Folks I don't have access to home directory. So I can't access .bashrc or .profile file. So the only option (I guess) is using the command for setting alias.

Is there any way to add alias permanently using any command (Without using .bashrc or .profile) ?

share|improve this question

migrated from stackoverflow.com Nov 1 '10 at 12:12

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

    
Does not belong here, but try alias --help, IIRC there is just one option.Not so hard. Try that next time first, always. –  leppie Nov 1 '10 at 11:58
1  
how come you don't have access to the home directory? I mean whoever the user you log in as, there should be a home directory –  動靜能量 Nov 1 '10 at 11:58
2  
You should contact your system administrator and ask the to fix your account instead. Or, if that no home / no access to .bashrc is by design, then you need to ask them to relax that policy. –  Janne Pikkarainen Nov 1 '10 at 12:25

1 Answer 1

If you don't have any permanent local storage, then you just can't make any permanent settings change. If you do have some permanent local storage that isn't your home directory (which would be pretty strange), you can run this every time you log in:

export HOME=/path/to/permanent/storage
. ~/.profile

You could put your settings in a file available somewhere on the web, at an URL you can remember easily. Then, assuming your home directory is writable (but, I suppose, erased when you log out or something like that), you can download that file and run it:

wget http://www.example.com/~suresh/.profile
. ./.profile

In addition to shell settings, this .profile might contain an archive that it unpacks when you run it, so that you get a .bashrc, a .emacs, a .vimrc, a .Xresources, and whatever else you like. The shar commands from sharutils creates an archive which is embedded in a shell script which unpacks the archive when you run it, relying only on ubiquitous utilities.

share|improve this answer

Your Answer

 
discard

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