bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

'file' command truncates at 31 characters (with long #! lines)


From: Stan Marsh
Subject: 'file' command truncates at 31 characters (with long #! lines)
Date: Sat, 06 Sep 2008 12:50:23 -0600

See below.  At step 2, the 'file' command truncates the final 'F' in the
filename.  I'm assuming some buffer is only 32 bytes long, so only strings
up to 31 characters are supported.  Note that the script does work just fine
(i.e., this version of Linux has no problem running a #! script where the
interpreter pathname is longer than 31 characters)

(1) % file --version
file-4.21
magic file from /etc/magic:/usr/share/file/magic
(2) % file bin/StartTimes 
bin/StartTimes: a /home/users/g/gazelle/bin/gawkO script text executable
(3) % head -1 bin/StartTimes
#!/home/users/g/gazelle/bin/gawkOF -f
(4) % head -1 bin/StartTimes | gawk '{for (i=1; i<=NF; i++) print 
i,length($i),$i}'
1 34 #!/home/users/g/gazelle/bin/gawkOF
2 2 -f
(5) % file bin/StartTimes | gawk '{for (i=1; i<=NF; i++) print i,length($i),$i}'
1 15 bin/StartTimes:
2 1 a
3 31 /home/users/g/gazelle/bin/gawkO
4 6 script
5 4 text
6 10 executable
(6) % dir bin/gawkOF 
8 -rwxr-xr-x 2 gazelle users 5108 2008-08-31 01:59 bin/gawkOF*
(7) % exit





reply via email to

[Prev in Thread] Current Thread [Next in Thread]