LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Solaris / OpenSolaris (https://www.linuxquestions.org/questions/solaris-opensolaris-20/)
-   -   Adding Commands to Shell (https://www.linuxquestions.org/questions/solaris-opensolaris-20/adding-commands-to-shell-607682/)

metallica1973 12-18-2007 02:33 PM

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?

crisostomo_enrico 12-18-2007 02:37 PM

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.

metallica1973 12-18-2007 02:47 PM

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 


metallica1973 12-18-2007 02:53 PM

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?

coolster 12-18-2007 02:55 PM

Quote:

Originally Posted by metallica1973 (Post 2995027)
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.

metallica1973 12-18-2007 02:57 PM

ok, so how would I change that is Solaris 10. I have looked everywhere. help?

crisostomo_enrico 12-18-2007 02:57 PM

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.

crisostomo_enrico 12-18-2007 02:59 PM

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.

metallica1973 12-18-2007 03:05 PM

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?

crisostomo_enrico 12-18-2007 03:19 PM

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.

metallica1973 12-18-2007 03:23 PM

how about when I login as root?

crisostomo_enrico 12-18-2007 03:26 PM

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.

metallica1973 12-18-2007 03:29 PM

so just create those files and then what about adding certain paths to certain files?

crisostomo_enrico 12-18-2007 03:31 PM

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.

Blinker_Fluid 12-20-2007 03:03 PM

Quote:

Originally Posted by metallica1973 (Post 2995036)
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


All times are GMT -5. The time now is 09:52 AM.