Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'try to avoid need to re-login' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
try to avoid need to re-login
Authored by: hayne on Jul 26, '02 12:08:32PM

It is not such a good idea to have a relogin as part of the script since if you use this script several times, you will build up many nested invocations of this script and nested login shells. Not such a big problem but a bit worrisome if you don't logout for weeks & weeks. (If you don't understand what I mean, try adding a line
echo "finished adding alias"
at the end of the script - you won't see the "finished ..." until you exit from the new shell you have created.)

You could avoid the need for re-login if you put the aliases in a separate file (.aliases or aliases.mine) since then all that would be needed to get the updated aliases is to 'source' the aliases file. But this source-ing of the aliases file can't be done from inside the script since that wouldn't affect the current shell. So you would need to use an alias to invoke the script and have the 'source' as part of the alias.

I also have a small quibble with the terminology used in the prompts. If I say:
alias copy cp
then the usual terminology is: "copy is an alias for the 'cp' command". Your prompts have this backwards.



[ Reply to This | # ]
try to avoid need to re-login
Authored by: agengler on Jul 26, '02 12:27:32PM

You could add a message to source ~/.cshrc and you won't need to login, or just add it to the code



[ Reply to This | # ]