Bug 203610

Summary: file reports "awk script text" even if script starts with #!/usr/bin/perl
Product: [Fedora] Fedora Reporter: Dieter Stumpner <d.stumpner>
Component: fileAssignee: Martin Bacovsky <mbacovsk>
Status: CLOSED DUPLICATE QA Contact: Mike McLean <mikem>
Severity: low Docs Contact:
Priority: medium    
Version: 5   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-08-23 08:51:05 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dieter Stumpner 2006-08-22 18:22:52 UTC
Description of problem:
file reports "awk script text" even if script starts with #!/usr/bin/perl
example:
[root]# file /usr/bin/spamd
/usr/bin/spamd: awk script text
[root]# head -n 1 /usr/bin/spamd
#!/usr/bin/perl -T -w
[root]# egrep -n BEGIN[[:space:]]*[{] /usr/bin/spamd
27:BEGIN {    # added by jm for use inside the distro
69:BEGIN {

Version-Release number of selected component (if applicable):
file-4.17-2.fc5
spamassassin-3.1.3-1.fc5

How reproducible:
file on perlscripts which use "BEGIN {"
also seen at perl scripts from twiki 

Steps to Reproduce:
1. file /usr/bin/spamd
2.
3.
  
Actual results:
/usr/bin/spamd: awk script text

Expected results:
/usr/bin/spamd: perl script text executable

Additional info:
[root]# egrep -n "(awk script text|perl script text)" /usr/share/file/magic
2915:0  string/b        #!\ /bin/nawk           new awk script text executable
2916:0  string/b        #!\ /usr/bin/nawk       new awk script text executable
2917:0  string/b        #!\ /usr/local/bin/nawk new awk script text executable
2918:0  string/b        #!\ /bin/gawk           GNU awk script text executable
2919:0  string/b        #!\ /usr/bin/gawk       GNU awk script text executable
2920:0  string/b        #!\ /usr/local/bin/gawk GNU awk script text executable
2922:0  string/b        #!\ /bin/awk            awk script text executable
2923:0  string/b        #!\ /usr/bin/awk        awk script text executable
2925:0  regex           BEGIN[[:space:]]*[{]    awk script text
9794:0  string/b        #!\ /bin/perl                   perl script text executable
9795:0  string          eval\ "exec\ /bin/perl          perl script text
9796:0  string/b        #!\ /usr/bin/perl               perl script text executable
9797:0  string          eval\ "exec\ /usr/bin/perl      perl script text
9798:0  string/b        #!\ /usr/local/bin/perl         perl script text
9799:0  string          eval\ "exec\ /usr/local/bin/perl        perl script text
executable
9800:0  string          eval\ '(exit\ $?0)'\ &&\ eval\ 'exec    perl script text

Comment 1 Martin Bacovsky 2006-08-23 08:51:05 UTC
It is same problem as in #202185. I will reopen it and fix the bug there. See it
for details.

*** This bug has been marked as a duplicate of 202185 ***