[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

alias command

Posted on 2006-05-25
8
Medium Priority
?
1,528 Views
Last Modified: 2013-12-27
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.
0
Comment
Question by:z670193
  • 5
  • 2
8 Comments
 
LVL 34

Expert Comment

by:PsiCop
ID: 16763676
The "#" prompt suggests you're logged in as root. In Solaris 8, the defualt shell for root is sh (Bourne shell), not bash.

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
0
 
LVL 48

Expert Comment

by:Tintin
ID: 16765193
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.
0
 

Author Comment

by:z670193
ID: 16773086
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.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 48

Expert Comment

by:Tintin
ID: 16778788
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

0
 

Author Comment

by:z670193
ID: 16780573
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.
0
 
LVL 48

Accepted Solution

by:
Tintin earned 750 total points
ID: 16780997
The most important thing you didn't post was the output of

type rm

after you have defined the alias.

You must be doing something that you're not telling us.  Here's a session from a Solaris 9 server that proves that aliases work just fine.

# uname -r
5.9
# echo $0
-sh
# exec ksh
# echo $0
ksh
# alias rm='rm -i'
# cd /tmp
# touch foobar
# rm foobar
rm: remove foobar (yes/no)? yes
# type rm
rm is an alias for rm -i

0
 
LVL 48

Expert Comment

by:Tintin
ID: 16781000
BTW, there is no configuration as such for aliases.

Generally, you either define aliases in your .profile or .kshrc files.
0
 
LVL 48

Expert Comment

by:Tintin
ID: 16794259
So could you tell us what was going wrong?  Did you do something that you didn't previously tell us?
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Why Shell Scripting? Shell scripting is a powerful method of accessing UNIX systems and it is very flexible. Shell scripts are required when we want to execute a sequence of commands in Unix flavored operating systems. “Shell” is the command line i…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses
Course of the Month18 days, 22 hours left to enroll

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question