Creating global alias

How do you create permanent aliases for all users in 5.2?

I want these two:

PDC # alias ccllive='cd /...... bla ....../livescripts'
PDC # alias ccltest='cd /...... bla ....../testscripts'

I created the aliases under root, but the users can't run the aliases.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

"alias" is a shell command. If you want a shell command to be excuted by all users when they login, then you can put it in /etc/profile. But settings made by alias are not replicated in child processes. Also, not all users have to use the same shell. So the general answer to your question will be somewhat complicated. You would have to create a .profile for each user which the user cannot change pointing to a similarly protected korn shell profile which sets the aliases. If I have time I will experiment and post back if I find the way.
JohnLucaniaAuthor Commented:
For each user, do you mean this?

PDC # vi .profile
".profile" 9 lines, 254 characters


export PATH

if [ -s "$MAIL" ]           # This is at Shell startup.  In normal
then echo "$MAILMSG"        # operation, the Shell checks
fi                          # periodically.
alias ccllive='cd /...bla.../livescripts'
alias ccltest='cd /...bla.../testscripts'

create another *.rc file in the root directory with execute permissions.
now add this file to be executed in all users .profile file

so whatever you will add in this single *.rc file, that will be effective for all users.

set aliases in /etc/profile

make sure /etc/profile and ~/.profile are not interactive - cron uses them and will hang on asked input.

Have fun.

for csh (not bask/ksh/sh) you have to include file into users .cshrc file, hope you do not have such users.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Unix OS

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.