Ask Question Forum:
Model Library:2025-02-08:A.I. model is online auto reply
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by duncanb7
at 2024-12-18 03:33:55
Point:500 Replies:9 POST_ID:828866USER_ID:11059
Topic:
Linux;Apache Web Server;Shell Scripting
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
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
==============
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.
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 definitionsif [ -f /etc/bashrc ]; then . /etc/bashrcfi 1:2:3:4:5:6:
Author: duncanb7 replied at 2024-12-18 05:25:48
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:
Duncan
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.
BEGIN failed--compilation aborted.
Duncan
Expert: simon3270 replied at 2024-12-18 05:12:25
I see we crossed over! Glad we sorted it out.
Simon
Simon
Expert: simon3270 replied at 2024-12-18 05:10:38
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.
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.
Author: duncanb7 replied at 2024-12-18 05:10:33
Thanks for your reply
Duncan
Duncan
Author: duncanb7 replied at 2024-12-18 05:10:07
//-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.
=====================
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.
Author: duncanb7 replied at 2024-12-18 04:21:03
Found it, what is different between /etc/profile and /etc/bashrc ?
and what is different between .bashrc and /etc/bashrc ?
and what is different between .bashrc and /etc/bashrc ?
Expert: simon3270 replied at 2024-12-18 03:55:31
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?
Which specific version of Linux are you using?
Author: duncanb7 replied at 2024-12-18 03:52:38
there is no such two directories at root or user account after checking
Accepted Solution
Expert: simon3270 replied at 2024-12-18 03:46:59
500 points EXCELLENT
/etc/bashrc and /etc/profile, if present, will also get called.