Link to home
Start Free TrialLog in
Avatar of duncanb7
duncanb7

asked on

Where is startup file when SSH access to my account

Dear Experts,

I have re-installed perl package, and then logout and login my account again.
After logging with login and password through SSH shell access, it prompt
me some error such as
Can't locate local/lib.pm in @INC (@INC contains: /usr/local/lib/perl5/site_perl/5.16.2/x86_64-linux /usr/local/lib/perl5/site_perl/5.16.2 /usr/local/lib/perl5/5.16.2/x86_64-linux /usr/local/lib/perl5/5.16.2 .).
BEGIN failed--compilation aborted.

that message is probably related to the old version of perl and path setup .

So I go to check my .bashrc script at my user account and root account , both files don't have any command related to perl. Where is such error perl command stored  so that  I can delete it and get rid of the error message or change the path to new version of perl.

So besides shell script, what is other linux startup files will run when user access account through SSH ?

And new version of perl is okay after check perl -v command

Please advise
Duncan


my .bashrc file at root or user account
==============
# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of simon3270
simon3270
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of duncanb7
duncanb7

ASKER

there is no such two directories  at root or user account after checking
They're not account-specific - they are files called /etc/bashrc and /etc/profile which are called for all logins - I'd be surprised if they weren't there.

Which specific version of Linux are you using?
Found it,  what is different between /etc/profile and /etc/bashrc ?

and what is different between .bashrc and /etc/bashrc ?
//-sh script running in profile
=====================
for i in /etc/profile.d/*.sh ; do
    if [ -r "$i" ]; then
        if [ "${-#*i}" != "$-" ]; then
            . "$i"
        else
            . "$i" >/dev/null 2>&1
        fi
    fi
done
//----------For  comment bashrc file------
if [ "$LOCALLIBUSER" != "root" ]; then
    eval $(perl -Mlocal::lib)
fi



in profile file, there is sh script running and  there is perl command saved in /profile.d/locallib.sh, just rename  it and
in bashrc, there is also perl command about perl -Mlocal::lib, just comment it
both is done and then the error message is removed.
Thanks for your reply


Duncan
If you start a login shell (e.g. when you log in, or if you run "su -"), /etc/profile is called, then it looks for .bash_profile .bash_login and .profile in that order, and sources the first one it finds .

If you start a non-login shell (e.g. you type "bash" at the shell prompt), .bashrc is called.  In your .bashrc, you can see that it in turn sources /etc/bashrc.

So, .bash_profile is the personal login profile file, and /etc/profile is the global one for all users.  Similarly .bashrc is per-user, and /etc/bashrc (if your .bashrc looks like it does here) is global.
I see we crossed over!  Glad we sorted it out.

Simon
For my memo only , now the solution is  avoiding or get rid of  error message  coming out after login but it is needed to find out the root cause of  perl command error in other new thread in future if need


perl command:   perl -Mlocal::lib

errror message which is deleted after login by this thread solution:
Can't locate local/lib.pm in @INC (@INC contains: /usr/local/lib/perl5/site_perl/5.16.2/x86_64-linux /usr/local/lib/perl5/site_perl/5.16.2 /usr/local/lib/perl5/5.16.2/x86_64-linux /usr/local/lib/perl5/5.16.2 .).
BEGIN failed--compilation aborted.

Duncan