LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 12-18-2007, 02:33 PM   #1
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Rep: Reputation: 60
Adding Commands to Shell


Using Solaris 10 where is it that you add the path to certain commands like:

/usr/local/bin/make and others?
 
Old 12-18-2007, 02:37 PM   #2
crisostomo_enrico
Member
 
Registered: Dec 2005
Location: Madrid
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547

Rep: Reputation: 36
Depends. One place for all users may be /etc/default/login.

Another place could be your shell initialization file, which depends on the shell you're using, and may include, for example, /etc/profile, .profile, .bash_profile, .bash_login, etc.
 
Old 12-18-2007, 02:47 PM   #3
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
I think that this is the BASH shell. I want the BASH shell as the default and I need to add commands to the path. I will look into what you suggested. thanks

PHP Code:
 echo $SHELL
/bin/sh 
 
Old 12-18-2007, 02:53 PM   #4
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
I have some of those files but now all of them and I didnt see where you specify what I want in the few files that I found. What gives?
 
Old 12-18-2007, 02:55 PM   #5
coolster
Member
 
Registered: Nov 2007
Distribution: Solaris 10, Solaris Nevada
Posts: 112

Rep: Reputation: 15
Quote:
Originally Posted by metallica1973 View Post
I think that this is the BASH shell.

PHP Code:
 echo $SHELL
/bin/sh 
Uh-uh, this is not the bash shell.
In spite of all urban legends the Bourne shell -which is what you 've got- is still the default for Solaris 10.
 
Old 12-18-2007, 02:57 PM   #6
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
ok, so how would I change that is Solaris 10. I have looked everywhere. help?
 
Old 12-18-2007, 02:57 PM   #7
crisostomo_enrico
Member
 
Registered: Dec 2005
Location: Madrid
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547

Rep: Reputation: 36
If you want to set a PATH for all user, simply edit /etc/default/login and that's done. If your shell is bash, which doesn't seem to be according to the output of echo $SHELL that you posted (check /etc/passwd, last field of your user's record), you can read bash man page:
Quote:
$ man bash
then look for INVOCATION section. If you're using vi as your pager, you can search for it using the / character. If you're not using vi or don't know:
Quote:
$ export PAGER="less -s"
$ man bash
The short story: when bash starts as login shell, it reads:
Quote:
/etc/profile (always)
~/.bash_profile (the first of these three)
~/.bash_login
~/.profile
Bye,
Enrico.
 
Old 12-18-2007, 02:59 PM   #8
crisostomo_enrico
Member
 
Registered: Dec 2005
Location: Madrid
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547

Rep: Reputation: 36
Quote:
ok, so how would I change that is Solaris 10. I have looked everywhere. help?
Always ready for help.

But in the future "everywhere" should include at least man pages.
In linux it's the _very_ same.
 
Old 12-18-2007, 03:05 PM   #9
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
I do not have any of these in my home directory.

PHP Code:
~/.bash_profile 
~/.bash_login
~/.profile 
are you sure about this is Solaris 10?

Last edited by metallica1973; 12-18-2007 at 03:06 PM.
 
Old 12-18-2007, 03:19 PM   #10
crisostomo_enrico
Member
 
Registered: Dec 2005
Location: Madrid
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547

Rep: Reputation: 36
No, that's not Solaris 10. That's bash. Create the file you like most and write down there the commands you want to execute at bash login.
 
Old 12-18-2007, 03:23 PM   #11
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
how about when I login as root?
 
Old 12-18-2007, 03:26 PM   #12
crisostomo_enrico
Member
 
Registered: Dec 2005
Location: Madrid
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547

Rep: Reputation: 36
The same, but be careful about changing root shell. I usually start a login bash (with bash -l) when I use root and want bash's specific features. Now, I'm trying to migrate myself to ksh.
 
Old 12-18-2007, 03:29 PM   #13
metallica1973
Senior Member
 
Registered: Feb 2003
Location: Washington D.C
Posts: 2,190

Original Poster
Rep: Reputation: 60
so just create those files and then what about adding certain paths to certain files?
 
Old 12-18-2007, 03:31 PM   #14
crisostomo_enrico
Member
 
Registered: Dec 2005
Location: Madrid
Distribution: Solaris 10, Solaris Express Community Edition
Posts: 547

Rep: Reputation: 36
In the case of using bash, you can
Code:
export PATH=/path/to/the/file/you/like:$PATH
Next time you login, you can check with
Code:
echo $PATH
that PATH has been correctly set and you should be able to run the programs you like.
 
Old 12-20-2007, 03:03 PM   #15
Blinker_Fluid
Member
 
Registered: Jul 2003
Location: Clinging to my guns and religion.
Posts: 683

Rep: Reputation: 63
Quote:
Originally Posted by metallica1973 View Post
ok, so how would I change that is Solaris 10. I have looked everywhere. help?
edit /etc/passwd and change /bin/sh to /bin/bash
 
  


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
Adding Commands canuck_barlow Linux - Newbie 3 09-29-2006 02:25 AM
Alias or shell script to confirm 'exit' commands from a shell rose_bud4201 Programming 2 03-08-2006 02:34 PM
adding my own commands to rc files SizofreNICK Slackware 8 11-07-2004 02:30 AM
Adding shell commands to hosts.deny and hosts.allow ridertech Linux - Security 3 12-29-2003 03:52 PM
adding commands? megaman Linux - Newbie 2 12-20-2003 03:57 PM

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

All times are GMT -5. The time now is 11:21 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