Bug 12181 - [Anolis23.2][Package][file]当前支持cr的,文件的二进制也是\r,实际file命令却没显示cr
Summary: [Anolis23.2][Package][file]当前支持cr的,文件的二进制也是\r,实际file命令却没显示cr
Status: NEW
Alias: None
Product: Anolis OS 23
Classification: Anolis OS
Component: BaseOS Packages (show other bugs) BaseOS Packages
Version: 23.2
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: gaochang
QA Contact: bolong_tbl
URL:
Whiteboard:
Keywords: Function
Depends on:
Blocks:
 
Reported: 2024-11-29 17:36 UTC by gaohongmei
Modified: 2024-11-29 17:41 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gaohongmei 2024-11-29 17:36:01 UTC
Description of problem:
当前是支持cr的,文件的二进制也是\r,但是实际file却没办法显示cr

Version-Release number of selected component (if applicable):
sh-5.2# cat /etc/os-release 
NAME="Anolis OS"
VERSION="23.1"
ID="anolis"
VERSION_ID="23.1"
PLATFORM_ID="platform:an23"
PRETTY_NAME="Anolis OS 23.1"
ANSI_COLOR="0;31"
HOME_URL="https://openanolis.cn/"
BUG_REPORT_URL="https://bugzilla.openanolis.cn/"

sh-5.2# uname -r
6.6.25-2.1.an23.aarch64

How reproducible:


Steps to Reproduce:
1.echo "cat /home/test.file" > /home/test.sh;chmod +x /home/test.sh
2.unix2mac /home/test.sh
3.file /home/test.sh

Actual results:

-sh-5.2# file -l | grep -i "Carriage Return"
Strength = 150@75: Maple help file with extra carriage return at start (yuck) []
-sh-5.2# file /home/test.sh
/home/test.sh: ASCII text, with no line terminators
-sh-5.2# od -c /home/test.sh
0000000   c   a   t       /   h   o   m   e   /   t   e   s   t   .   f
0000020   i   l   e  \r
0000024
-sh-5.2#

Expected results:

alinux3 上的版本:

[root@iZbp17b28qbu91lz1t3t8cZ ~]# file --version
file-5.33
magic file from /etc/magic:/usr/share/misc/magic
[root@iZbp17b28qbu91lz1t3t8cZ ~]# file -l | grep -i carrige
[root@iZbp17b28qbu91lz1t3t8cZ ~]# file -l | grep -i "Carriage Return"
Strength = 150@23: Maple help file with extra carriage return at start (yuck) []
[root@iZbp17b28qbu91lz1t3t8cZ ~]# file /home/test.sh
/home/test.sh: ASCII text, with CR line terminators
[root@iZbp17b28qbu91lz1t3t8cZ ~]# od -c /home/test.sh
0000000   c   a   t       /   h   o   m   e   /   t   e   s   t   .   f
0000020   i   l   e  \r
0000024

Additional info: