您尚未登录。

#1 2020-09-24 22:37:55

elliotchan
会员
注册时间: 2020-09-24
帖子: 5

每次登录后都会提示/etc/profile.d/perlbin.sh内的命令执行错误

perlbin.sh内容
$ cat /etc/profile.d/perlbin.sh
# Set path to perl scriptdirs if they exist
# https://wiki.archlinux.org/index.php/Pe … nd_scripts
# Added /usr/bin/*_perl dirs for scripts

[ -d /usr/bin/site_perl ] && append_path '/usr/bin/site_perl'

[ -d /usr/bin/vendor_perl ] && append_path '/usr/bin/vendor_perl'

[ -d /usr/bin/core_perl ] && append_path '/usr/bin/core_perl'

export PATH

# If you have modules in non-standard directories you can add them here.
#export PERLLIB=dir1:dir2



终端输出的错误内容
-bash: append_path: command not found
-bash: append_path: command not found
-bash: append_path: command not found


内核版本 5.8.10-arch1-1

请问可能是哪里出现了错误

离线

#2 2020-09-24 23:28:56

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,384
个人网站

Re: 每次登录后都会提示/etc/profile.d/perlbin.sh内的命令执行错误

pacman -Qo /etc/profile.d/perlbin.sh
pacman -Qkk perl

离线

#3 2020-09-25 10:49:06

elliotchan
会员
注册时间: 2020-09-24
帖子: 5

Re: 每次登录后都会提示/etc/profile.d/perlbin.sh内的命令执行错误

依云 说:
pacman -Qo /etc/profile.d/perlbin.sh
pacman -Qkk perl
[root@archlinux ~]# pacman -Qo /etc/profile.d/perlbin.sh
/etc/profile.d/perlbin.sh is owned by perl 5.32.0-3
[root@archlinux ~]# pacman -Qkk perl
warning: perl: /etc/profile.d/perlbin.sh (Permissions mismatch)
perl: 2799 total files, 1 altered file

离线

#4 2020-09-25 11:51:21

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,384
个人网站

Re: 每次登录后都会提示/etc/profile.d/perlbin.sh内的命令执行错误

文件被修改过?删掉然后重装 perl 包呢?

离线

#5 2020-09-25 12:22:25

elliotchan
会员
注册时间: 2020-09-24
帖子: 5

Re: 每次登录后都会提示/etc/profile.d/perlbin.sh内的命令执行错误

依云 说:

文件被修改过?删掉然后重装 perl 包呢?

没有,试过先删除perlbin.sh这个文件,然后再重新安装perl包,现在这个文件就是重新安装以后生成的

# elliot @ archlinux in ~ [12:23:45] 
$ sudo rm /etc/profile.d/perlbin.sh
[sudo] password for elliot: 

# elliot @ archlinux in ~ [12:23:51] 
$ ls /etc/profile.d                
freetype2.sh  gawk.csh  gawk.sh  gpm.sh  jre.csh  jre.sh  locale.sh  perlbin.csh  vte.csh  vte.sh

# elliot @ archlinux in ~ [12:23:54] 
$ yay -S perl 
warning: perl-5.32.0-3 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (1) perl-5.32.0-3

Total Installed Size:  57.61 MiB
Net Upgrade Size:       0.00 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                                                                 [########################################################] 100%
(1/1) checking package integrity                                                               [########################################################] 100%
(1/1) loading package files                                                                    [########################################################] 100%
(1/1) checking for file conflicts                                                              [########################################################] 100%
(1/1) checking available disk space                                                            [########################################################] 100%
warning: could not get file information for etc/profile.d/perlbin.sh
:: Processing package changes...
(1/1) reinstalling perl                                                                        [########################################################] 100%
:: Running post-transaction hooks...
(1/2) Arming ConditionNeedsUpdate...
(2/2) Warn about old perl modules

# elliot @ archlinux in ~ [12:24:01] 
$ ls /etc/profile.d
freetype2.sh  gawk.csh  gawk.sh  gpm.sh  jre.csh  jre.sh  locale.sh  perlbin.csh  perlbin.sh  vte.csh  vte.sh

# elliot @ archlinux in ~ [12:24:06] 
$ cat /etc/profile.d/perlbin.sh 
# Set path to perl scriptdirs if they exist
# https://wiki.archlinux.org/index.php/Perl_Policy#Binaries_and_scripts
# Added /usr/bin/*_perl dirs for scripts

[ -d /usr/bin/site_perl ] && append_path '/usr/bin/site_perl'

[ -d /usr/bin/vendor_perl ] && append_path '/usr/bin/vendor_perl'

[ -d /usr/bin/core_perl ] && append_path '/usr/bin/core_perl'

export PATH

# If you have modules in non-standard directories you can add them here.
#export PERLLIB=dir1:dir2

最近编辑记录 elliotchan (2020-09-25 12:24:55)

离线

#6 2020-09-25 12:30:07

elliotchan
会员
注册时间: 2020-09-24
帖子: 5

Re: 每次登录后都会提示/etc/profile.d/perlbin.sh内的命令执行错误

elliotchan 说:
依云 说:
pacman -Qo /etc/profile.d/perlbin.sh
pacman -Qkk perl
[root@archlinux ~]# pacman -Qo /etc/profile.d/perlbin.sh
/etc/profile.d/perlbin.sh is owned by perl 5.32.0-3
[root@archlinux ~]# pacman -Qkk perl
warning: perl: /etc/profile.d/perlbin.sh (Permissions mismatch)
perl: 2799 total files, 1 altered file

这个警告是我测试问题在哪的时候chmod +x 引发的

离线

#7 2020-09-25 12:44:47

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,384
个人网站

Re: 每次登录后都会提示/etc/profile.d/perlbin.sh内的命令执行错误

哦,最新的 perl 改了。
那看看你的 /etc/profile 里是不是没有定义 append_path 这个函数?

离线

#8 2020-09-25 14:41:03

elliotchan
会员
注册时间: 2020-09-24
帖子: 5

Re: 每次登录后都会提示/etc/profile.d/perlbin.sh内的命令执行错误

依云 说:

哦,最新的 perl 改了。
那看看你的 /etc/profile 里是不是没有定义 append_path 这个函数?

/etc/profile 里面定义了appendpath, 没有appedn_path。。。
谢谢仙子

最近编辑记录 elliotchan (2020-09-25 14:41:23)

离线

#9 2020-09-27 11:48:54

HIDE
会员
注册时间: 2020-06-22
帖子: 12

Re: 每次登录后都会提示/etc/profile.d/perlbin.sh内的命令执行错误

重新安装一下filesystem这个包就没问题了.这么粗暴的改,我也不知道我的动作是否规范。但是这个问题是解决了。不知道会不会引起别的问题。或者根据commit,把/etc/profile.d/perlbin.sh的内容改回去也没问题。

$ mv /etc/profile /etc/profile.bak
$ sudo pacman -S filesystem
$ diff /etc/profile /etc/profile.bak
6,8c6,7
< # Append "$1" to $PATH when not already in.
< # This function API is accessible to scripts in /etc/profile.d
< append_path () {
---
> # Append our default paths
> appendpath () {
17,20c16,19
< # Append our default paths
< append_path '/usr/local/sbin'
< append_path '/usr/local/bin'
< append_path '/usr/bin'
---
> appendpath '/usr/local/sbin'
> appendpath '/usr/local/bin'
> appendpath '/usr/bin'
> unset -f appendpath
22d20
< # Force PATH to be environment
33,35d30
< # Unload our profile API functions
< unset -f append_path
<
50a46,47
>
> #===================================================================================

Ref:
https://forum.manjaro.org/t/testing-upd … ll/27893/6
(Bug) FS#67990 - append_path not defined
(commit) Check if PATH is already set in $PATH

离线

页脚