• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1192
  • Last Modified:

Run setup.sh when BASH shell starts.

I am sharing an account on a SUN unix box.  The owner of the account refuses to set a default shell.  When you first log in you have to start the desired shell.

Currently I am using the bash shell.  So when I login, I type the following:
  bash
  . ./setup.sh
(setup.sh initialises my personal aliases)

My question is:  Is there a way for me to do the same in one line?

In Windows shell I can do this by just typing CMD batfile.bat.
0
MogalManic
Asked:
MogalManic
1 Solution
 
avizitCommented:
you can type
 bash ../setup.sh

or source setup.sh  will work too i think

also read

read http:Q_10153144.html
0
 
tfewsterCommented:
Why not copy the contents of setup.sh to .bash_profile?

Then, if you start bash with `bash --login`, it will execute your .bash_profile and set up the environment for you.

Or, have the command do `. ./setup.sh` in the .bash_profile.
0
 
TintinCommented:
No need to type in anything.

Let's assume your default shell is /bin/sh, then in your .profile, put

[ -x /usr/bin/bash ] && exec /usr/bin/bash --login

And put the contents of setup.sh in your .bash_profile or call it from your .bash_profile
0
 
pankajtiwaryCommented:
If you are using bash shell, the easiest way to do this is open the .bash_profile in some editor, go to the last and in a new line type ../setip.sh
0
 
pankajtiwaryCommented:
MogalManic,
 Sorry for the typo, it should be ../setup.sh
0

Featured Post

Technology Partners: 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!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now