xref: /freebsd/contrib/file/magic/Magdir/commands (revision af23369a6deaaeb612ab266eb88b8bb8d560c322)
1
2#------------------------------------------------------------------------------
3# $File: commands,v 1.69 2022/04/20 21:14:23 christos Exp $
4# commands:  file(1) magic for various shells and interpreters
5#
6#0	string/w	:			shell archive or script for antique kernel text
70	string/fwt	#!\ /bin/sh		POSIX shell script text executable
8!:mime	text/x-shellscript
90	string/fwb	#!\ /bin/sh		POSIX shell script executable (binary data)
10!:mime	text/x-shellscript
11
120	string/fwt	#!\ /bin/csh		C shell script text executable
13!:mime	text/x-shellscript
14
15# korn shell magic, sent by George Wu, gwu@clyde.att.com
160	string/fwt	#!\ /bin/ksh		Korn shell script text executable
17!:mime	text/x-shellscript
180	string/fwb	#!\ /bin/ksh		Korn shell script executable (binary data)
19!:mime	text/x-shellscript
20
210	string/fwt 	#!\ /bin/tcsh		Tenex C shell script text executable
22!:mime	text/x-shellscript
230	string/fwt	#!\ /usr/bin/tcsh	Tenex C shell script text executable
24!:mime	text/x-shellscript
250	string/fwt 	#!\ /usr/local/tcsh	Tenex C shell script text executable
26!:mime	text/x-shellscript
270	string/fwt	#!\ /usr/local/bin/tcsh	Tenex C shell script text executable
28!:mime	text/x-shellscript
29
30#
31# zsh/ash/ae/nawk/gawk magic from cameron@cs.unsw.oz.au (Cameron Simpson)
320	string/fwt	#!\ /bin/zsh		Paul Falstad's zsh script text executable
33!:mime	text/x-shellscript
340	string/fwt	#!\ /usr/bin/zsh	Paul Falstad's zsh script text executable
35!:mime	text/x-shellscript
360	string/fwt	#!\ /usr/local/bin/zsh	Paul Falstad's zsh script text executable
37!:mime	text/x-shellscript
380	string/fwt	#!\ /usr/bin/env\ zsh	Paul Falstad's zsh script text executable
39!:mime	text/x-shellscript
40
410	string/fwt	#!\ /bin/ash		Neil Brown's ash script text executable
42!:mime	text/x-shellscript
430	string/fwt	#!\ /usr/bin/ash	Neil Brown's ash script text executable
44!:mime	text/x-shellscript
450	string/fwt	#!\ /usr/local/bin/ash	Neil Brown's ash script text executable
46!:mime	text/x-shellscript
470	string/fwt	#!\ /usr/local/bin/ae	Neil Brown's ae script text executable
48!:mime	text/x-shellscript
490	string/fwt	#!\ /bin/nawk		new awk script text executable
50!:mime	text/x-nawk
510	string/fwt	#!\ /usr/bin/nawk	new awk script text executable
52!:mime	text/x-nawk
530	string/fwt	#!\ /usr/local/bin/nawk	new awk script text executable
54!:mime	text/x-nawk
550	string/fwt	#!\ /bin/gawk		GNU awk script text executable
56!:mime	text/x-gawk
570	string/wt	#!\ /usr/bin/gawk	GNU awk script text executable
58!:mime	text/x-gawk
590	string/fwt	#!\ /usr/local/bin/gawk	GNU awk script text executable
60!:mime	text/x-gawk
61#
620	string/fwt	#!\ /bin/awk		awk script text executable
63!:mime	text/x-awk
640	string/fwt	#!\ /usr/bin/awk	awk script text executable
65!:mime	text/x-awk
660	regex/4096	=^[\040\t\f\r\n]{0,100}BEGIN[\040\t\f\r\n]{0,100}[{]	awk or perl script text
67
68# AT&T Bell Labs' Plan 9 shell
690	string/fwt	#!\ /bin/rc	Plan 9 rc shell script text executable
70
71# bash shell magic, from Peter Tobias (tobias@server.et-inf.fho-emden.de)
720	string/fwt	#!\ /bin/bash	Bourne-Again shell script text executable
73!:mime	text/x-shellscript
740	string/fwb	#!\ /bin/bash	Bourne-Again shell script executable (binary data)
75!:mime	text/x-shellscript
760	string/fwt	#!\ /usr/bin/bash	Bourne-Again shell script text executable
77!:mime	text/x-shellscript
780	string/fwb	#!\ /usr/bin/bash	Bourne-Again shell script executable (binary data)
79!:mime	text/x-shellscript
800	string/fwt	#!\ /usr/local/bash	Bourne-Again shell script text executable
81!:mime	text/x-shellscript
820	string/fwb	#!\ /usr/local/bash	Bourne-Again shell script executable (binary data)
83!:mime	text/x-shellscript
840	string/fwt	#!\ /usr/local/bin/bash	Bourne-Again shell script text executable
85!:mime	text/x-shellscript
860	string/fwb	#!\ /usr/local/bin/bash	Bourne-Again shell script executable (binary data)
87!:mime	text/x-shellscript
880	string/fwt	#!\ /usr/bin/env\ bash	Bourne-Again shell script text executable
89!:mime	text/x-shellscript
90
91# Fish shell magic
92# From: Benjamin Lowry <ben@ben.gmbh>
930	string/fwt	#!\ /usr/local/bin/fish		fish shell script text executable
94!:mime	text/x-shellscript
950	string/fwt	#!\ /usr/bin/fish		fish shell script text executable
96!:mime	text/x-shellscript
970	string/fwt	#!\ /usr/bin/env\ fish		fish shell script text executable
98!:mime	text/x-shellscript
99
1000	string/wt	#!\ 	a
101>&-1	string/T	x	%s script text executable
102
1030	search/1/fwt	#!\ /usr/bin/tclsh	Tcl/Tk script text executable
104!:mime  text/x-tcl
105
1060	search/1/fwt	#!\ /usr/bin/texlua	LuaTex script text executable
107!:mime	text/x-luatex
108
1090	search/1/fwt	#!\ /usr/bin/luatex	LuaTex script text executable
110!:mime	text/x-luatex
111
1120	search/1/fwt	#!\ /usr/bin/stap	Systemtap script text executable
113!:mime  text/x-systemtap
114
115# From: Kylie McClain <kylie@somas.is>
116# Type: execline scripts
117# URL:  https://skarnet.org/software/execline/
1180	string/fwt	#!\ /command/execlineb		execline script text executable
119!:mime	text/x-execline
1200	string/fwt	#!\ /bin/execlineb		execline script text executable
121!:mime	text/x-execline
1220	string/fwt	#!\ /usr/bin/execlineb		execline script text executable
123!:mime	text/x-execline
1240	string/fwt	#!\ /usr/bin/env\ execlineb		execline script text executable
125!:mime	text/x-execline
126
1270	string	#!
128>0	regex	\^#!.*/bin/execlineb([[:space:]].*)*$	execline script text executable
129!:mime	text/x-execline
130
131# PHP scripts
132# Ulf Harnhammar <ulfh@update.uu.se>
1330	search/1/c	=<?php			PHP script text
134!:strength + 30
135!:mime	text/x-php
1360	search/1	=<?\n			PHP script text
137!:mime	text/x-php
1380	search/1	=<?\r			PHP script text
139!:mime	text/x-php
1400	search/1/w	#!\ /usr/local/bin/php	PHP script text executable
141!:strength + 10
142!:mime	text/x-php
1430	search/1/w	#!\ /usr/bin/php	PHP script text executable
144!:strength + 10
145!:mime	text/x-php
146# Smarty compiled template, https://www.smarty.net/
147# Elan Ruusamae <glen@delfi.ee>
1480	string	=<?php
149>5	regex	[\ \n]
150>>6	string	/*\ Smarty\ version		Smarty compiled template
151>>>24	regex	[0-9.]+				\b, version %s
152!:mime	text/x-php
153
1540	string		Zend\x00		PHP script Zend Optimizer data
155
156# From: Anatol Belski <ab@php.net>
1570	string		OPCACHE
158>7	ubyte		0			PHP opcache filecache data
159
1600	search/64	--TEST--
161>16	search/64	--FILE--
162>24	search/8192	--EXPECT		PHP core test
163!:ext	phpt
164
165# https://www.php.net/manual/en/phar.fileformat.signature.php
166-4	string		GBMB			PHP phar archive
167>-8	ubyte		0x1			with MD5 signature
168!:ext	phar
169>-8	ubyte		0x2			with SHA1 signature
170!:ext	phar
171>-8	ubyte		0x3			with SHA256 signature
172!:ext	phar
173>-8	ubyte		0x4			with SHA512 signature
174!:ext	phar
175>-8	ubyte		0x10			with OpenSSL signature
176!:ext	phar
177>-8	ubyte		0x11			with OpenSSL SHA256 signature
178!:ext	phar
179>-8	ubyte		0x12			with OpenSSL SHA512 signature
180!:ext	phar
181
1820	string/t	$!			DCL command file
183
184# Type: Pdmenu
185# URL:  https://packages.debian.org/pdmenu
186# From: Edward Betts <edward@debian.org>
1870	string		#!/usr/bin/pdmenu	Pdmenu configuration file text
188
189# From Danny Weldon
1900	string	\x0b\x13\x08\x00
191>0x04   uleshort	<4      ksh byte-code version %d
192