Bareword "mp4" not allowed while "strict subs" in use at (user-supplied code).

2021/10/24 7:11:25

本文主要是介绍Bareword "mp4" not allowed while "strict subs" in use at (user-supplied code).,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

1、查看内核

root@PC1:~/GS/lihua/test# hostnamectl
   Static hostname: PC1
         Icon name: computer-vm
           Chassis: vm
        Machine ID: dc50d4dc469c45ea8a2a10f39caa45e9
           Boot ID: 28566ddce150405d8573cdbbd676465d
    Virtualization: vmware
  Operating System: Ubuntu 20.04.3 LTS
            Kernel: Linux 5.11.0-38-generic
      Architecture: x86-64

 

2、问题, 在红帽、centos中不会出现这样的问题

root@PC1:~/GS/lihua/test# ls
a.mp4  dup1.mp4  dup2.mp4  dup4.mp4
root@PC1:~/GS/lihua/test# rename mp4 txt *
Bareword "mp4" not allowed while "strict subs" in use at (user-supplied code).

 

 

3、经查询找到的解决方法,类似sed的替换命令

root@PC1:~/GS/lihua/test# ls
a.mp4  dup1.mp4  dup2.mp4  dup4.mp4
root@PC1:~/GS/lihua/test# rename 's/mp4/txt/' *
root@PC1:~/GS/lihua/test# ls
a.txt  dup1.txt  dup2.txt  dup4.txt

 

参考:http://cssor.com/linux-rename-files.html

 



这篇关于Bareword "mp4" not allowed while "strict subs" in use at (user-supplied code).的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程