z670193
asked on
alias command
Hi Experts,
I am using Solaris 8 and am trying to set up some aliases. I tried using the following command:
#alias rm='rm -i'
and this would not effect anything -- no error message either.
there are already some alias set up, and I tried unaliasing it, and that wouldn't work either.
where is the configuration file for manipulating alias command?
any input would be really appreciated.
Thank you.
I am using Solaris 8 and am trying to set up some aliases. I tried using the following command:
#alias rm='rm -i'
and this would not effect anything -- no error message either.
there are already some alias set up, and I tried unaliasing it, and that wouldn't work either.
where is the configuration file for manipulating alias command?
any input would be really appreciated.
Thank you.
alias is available in csh, tcsh, ksh, bash and zsh
As PsiCop says, the default root shell on Solaris is /sbin/sh (bourne shell) which doesn't support aliases.
As PsiCop says, the default root shell on Solaris is /sbin/sh (bourne shell) which doesn't support aliases.
ASKER
Yes, I am logged in as root. I am aware that the default shell for root is sh. I am in ksh, and "#" prompt is suggesting ksh. And I believe alias functionality is possible with ksh.
Any further input would be appreciated. Thank you.
Any further input would be appreciated. Thank you.
The # prompt doesn't indicate anything. You could be using *any* shell with a # prompt
What does
echo $0
echo $SHELL
return?
*How* are you determining is "isn't working"?
What is the output of
type rm
What does
echo $0
echo $SHELL
return?
*How* are you determining is "isn't working"?
What is the output of
type rm
ASKER
echo $0
ksh
Like I have already mentioned, I tried using alias with rm as rm -i.
After using the alias command, I checked the effective aliases and the entry for rm as rm -i was not there.
I also tried deleting a file with rm command, and the alias was not effective.
So, my question is if there is any configuration file for the alias command.
Any proper input would be appreciated and rewarded.
Thank you.
ksh
Like I have already mentioned, I tried using alias with rm as rm -i.
After using the alias command, I checked the effective aliases and the entry for rm as rm -i was not there.
I also tried deleting a file with rm command, and the alias was not effective.
So, my question is if there is any configuration file for the alias command.
Any proper input would be appreciated and rewarded.
Thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
BTW, there is no configuration as such for aliases.
Generally, you either define aliases in your .profile or .kshrc files.
Generally, you either define aliases in your .profile or .kshrc files.
So could you tell us what was going wrong? Did you do something that you didn't previously tell us?
The "alias" built-in is a component of bash, not sh.
BTW, do NOT change root's shell! Its fine for you to manually run bash once you've logged in as root, but leave it as /bin/sh in /etc/passwd