LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 02-14-2008, 03:27 AM   #1
markraem
Member
 
Registered: Nov 2003
Posts: 82

Rep: Reputation: 15
how to create linux like alias in solaris 10 ?


in linux, in /etc/bashrc, you can create aliases like :
alias sysbin ='cd /usr/bin'

in bash you can then type the alias command and see the sysbin alias and after typing sysbin you will be in the /usr/bin directory.

How can this be done in solaris 10 ?
the alias does not exist and /etc/bashrc neither.

I know there is the set command in solaris, but can I create varaibles which are actually not variables, but commands like 'cd /usr/bin' ?


thanx in advance/
 
Old 02-14-2008, 07:15 AM   #2
crisostomo_enrico
Member
 
Registered: Dec 2005
Location: Madrid
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547

Rep: Reputation: 36
Are you sure you're using bash? bash is not the default shell that solaris assigns to new users and there's no default /etc/bashrc either. If you read man bash and go to INVOCATION section you'll discover you have many possibilities to customize bash. If you want to customize bash for your user, you can just touch and edit several files in your user home directory such as .bash_profile, .bash_login, .bash_logout and .profile.

Bye,
Enrico.
 
Old 02-14-2008, 09:14 AM   #3
jlliagre
Moderator
 
Registered: Feb 2004
Location: Outside Paris
Distribution: Solaris 11.4, Oracle Linux, Mint, Debian/WSL
Posts: 9,789

Rep: Reputation: 492Reputation: 492Reputation: 492Reputation: 492Reputation: 492
On the other hand, you can keep using sh or better switch to ksh which is generally preferred on Solaris and just use the same alias syntax. You'll simply need to use /etc/profile instead of /etc/bashrc for system wide aliases.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Porting alias file to from solaris to linux tcsh chrisrose21117 Linux - Newbie 2 09-27-2007 12:31 PM
create alias on apache 1.3 ALInux Linux - Networking 2 04-01-2006 03:20 AM
create alias ohade Mandriva 1 08-09-2005 04:12 PM
create alias for root powah SUSE / openSUSE 1 04-25-2005 12:19 PM
create a shortcut/alias allelopath Linux - Software 6 04-01-2003 09:45 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 04:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration