xref: /freebsd/contrib/file/magic/Magdir/commands (revision 5e3934b15a2741b2de6b217e77dc9d798d740804)
1
2#------------------------------------------------------------------------------
3# $File: commands,v 1.73 2022/11/06 18:39: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>10	string	#\040This\040script\040was\040generated\040using\040Makeself	\b, self-executable archive
12>>53	string	x	\b, Makeself %s
13
140	string/fwt	#!\ /bin/csh		C shell script text executable
15!:mime	text/x-shellscript
16
17# korn shell magic, sent by George Wu, gwu@clyde.att.com
180	string/fwt	#!\ /bin/ksh		Korn shell script text executable
19!:mime	text/x-shellscript
200	string/fwb	#!\ /bin/ksh		Korn shell script executable (binary data)
21!:mime	text/x-shellscript
22
230	string/fwt 	#!\ /bin/tcsh		Tenex C shell script text executable
24!:mime	text/x-shellscript
250	string/fwt	#!\ /usr/bin/tcsh	Tenex C shell script text executable
26!:mime	text/x-shellscript
270	string/fwt 	#!\ /usr/local/tcsh	Tenex C shell script text executable
28!:mime	text/x-shellscript
290	string/fwt	#!\ /usr/local/bin/tcsh	Tenex C shell script text executable
30!:mime	text/x-shellscript
31
32#
33# zsh/ash/ae/nawk/gawk magic from cameron@cs.unsw.oz.au (Cameron Simpson)
340	string/fwt	#!\ /bin/zsh		Paul Falstad's zsh script text executable
35!:mime	text/x-shellscript
360	string/fwt	#!\ /usr/bin/zsh	Paul Falstad's zsh script text executable
37!:mime	text/x-shellscript
380	string/fwt	#!\ /usr/local/bin/zsh	Paul Falstad's zsh script text executable
39!:mime	text/x-shellscript
400	string/fwt	#!\ /usr/bin/env\ zsh	Paul Falstad's zsh script text executable
41!:mime	text/x-shellscript
42
430	string/fwt	#!\ /bin/ash		Neil Brown's ash script text executable
44!:mime	text/x-shellscript
450	string/fwt	#!\ /usr/bin/ash	Neil Brown's ash script text executable
46!:mime	text/x-shellscript
470	string/fwt	#!\ /usr/local/bin/ash	Neil Brown's ash script text executable
48!:mime	text/x-shellscript
490	string/fwt	#!\ /usr/local/bin/ae	Neil Brown's ae script text executable
50!:mime	text/x-shellscript
510	string/fwt	#!\ /bin/nawk		new awk script text executable
52!:mime	text/x-nawk
530	string/fwt	#!\ /usr/bin/nawk	new awk script text executable
54!:mime	text/x-nawk
550	string/fwt	#!\ /usr/local/bin/nawk	new awk script text executable
56!:mime	text/x-nawk
570	string/fwt	#!\ /bin/gawk		GNU awk script text executable
58!:mime	text/x-gawk
590	string/wt	#!\ /usr/bin/gawk	GNU awk script text executable
60!:mime	text/x-gawk
610	string/fwt	#!\ /usr/local/bin/gawk	GNU awk script text executable
62!:mime	text/x-gawk
63#
640	string/fwt	#!\ /bin/awk		awk script text executable
65!:mime	text/x-awk
660	string/fwt	#!\ /usr/bin/awk	awk script text executable
67!:mime	text/x-awk
680	regex/4096	=^[\040\t\f\r\n]{0,100}BEGIN[\040\t\f\r\n]{0,100}[{]	awk or perl script text
69
70# AT&T Bell Labs' Plan 9 shell
710	string/fwt	#!\ /bin/rc	Plan 9 rc shell script text executable
72
73# bash shell magic, from Peter Tobias (tobias@server.et-inf.fho-emden.de)
740	string/fwt	#!\ /bin/bash	Bourne-Again shell script text executable
75!:mime	text/x-shellscript
760	string/fwb	#!\ /bin/bash	Bourne-Again shell script executable (binary data)
77!:mime	text/x-shellscript
780	string/fwt	#!\ /usr/bin/bash	Bourne-Again shell script text executable
79!:mime	text/x-shellscript
800	string/fwb	#!\ /usr/bin/bash	Bourne-Again shell script executable (binary data)
81!:mime	text/x-shellscript
820	string/fwt	#!\ /usr/local/bash	Bourne-Again shell script text executable
83!:mime	text/x-shellscript
840	string/fwb	#!\ /usr/local/bash	Bourne-Again shell script executable (binary data)
85!:mime	text/x-shellscript
860	string/fwt	#!\ /usr/local/bin/bash	Bourne-Again shell script text executable
87!:mime	text/x-shellscript
880	string/fwb	#!\ /usr/local/bin/bash	Bourne-Again shell script executable (binary data)
89!:mime	text/x-shellscript
900	string/fwt	#!\ /usr/bin/env\ bash	Bourne-Again shell script text executable
91!:mime	text/x-shellscript
92
93# Fish shell magic
94# From: Benjamin Lowry <ben@ben.gmbh>
950	string/fwt	#!\ /usr/local/bin/fish		fish shell script text executable
96!:mime	text/x-shellscript
970	string/fwt	#!\ /usr/bin/fish		fish shell script text executable
98!:mime	text/x-shellscript
990	string/fwt	#!\ /usr/bin/env\ fish		fish shell script text executable
100!:mime	text/x-shellscript
101
1020	search/1/fwt	#!\ /usr/bin/tclsh	Tcl/Tk script text executable
103!:mime  text/x-tcl
104
1050	search/1/fwt	#!\ /usr/bin/texlua	LuaTex script text executable
106!:mime	text/x-luatex
107
1080	search/1/fwt	#!\ /usr/bin/luatex	LuaTex script text executable
109!:mime	text/x-luatex
110
1110	search/1/fwt	#!\ /usr/bin/stap	Systemtap script text executable
112!:mime  text/x-systemtap
113
114# From: Kylie McClain <kylie@somas.is>
115# Type: execline scripts
116# URL:  https://skarnet.org/software/execline/
1170	string/fwt	#!\ /command/execlineb		execline script text executable
118!:mime	text/x-execline
1190	string/fwt	#!\ /bin/execlineb		execline script text executable
120!:mime	text/x-execline
1210	string/fwt	#!\ /usr/bin/execlineb		execline script text executable
122!:mime	text/x-execline
1230	string/fwt	#!\ /usr/bin/env\ execlineb		execline script text executable
124!:mime	text/x-execline
125
1260	string	#!
127>0	regex	\^#!.*/bin/execlineb([[:space:]].*)*$	execline script text executable
128!:mime	text/x-execline
129
130# PHP scripts
131# Ulf Harnhammar <ulfh@update.uu.se>
1320	search/1/c	=<?php			PHP script text
133!:strength + 30
134!:mime	text/x-php
1350	search/1	=<?\n			PHP script text
136!:mime	text/x-php
1370	search/1	=<?\r			PHP script text
138!:mime	text/x-php
1390	search/1/w	#!\ /usr/local/bin/php	PHP script text executable
140!:strength + 10
141!:mime	text/x-php
1420	search/1/w	#!\ /usr/bin/php	PHP script text executable
143!:strength + 10
144!:mime	text/x-php
145# Smarty compiled template, https://www.smarty.net/
146# Elan Ruusamae <glen@delfi.ee>
1470	string	=<?php
148>5	regex	[\ \n]
149>>6	string	/*\ Smarty\ version		Smarty compiled template
150>>>24	regex	[0-9.]+				\b, version %s
151!:mime	text/x-php
152
1530	string		Zend\x00		PHP script Zend Optimizer data
154
155# From: Anatol Belski <ab@php.net>
1560	string		OPCACHE
157>7	ubyte		0			PHP opcache filecache data
158
1590	search/64	--TEST--
160>16	search/64	--FILE--
161>24	search/8192	--EXPECT		PHP core test
162!:ext	phpt
163
164# https://www.php.net/manual/en/phar.fileformat.signature.php
165-4	string		GBMB			PHP phar archive
166>-8	ubyte		0x1			with MD5 signature
167!:ext	phar
168>-8	ubyte		0x2			with SHA1 signature
169!:ext	phar
170>-8	ubyte		0x3			with SHA256 signature
171!:ext	phar
172>-8	ubyte		0x4			with SHA512 signature
173!:ext	phar
174>-8	ubyte		0x10			with OpenSSL signature
175!:ext	phar
176>-8	ubyte		0x11			with OpenSSL SHA256 signature
177!:ext	phar
178>-8	ubyte		0x12			with OpenSSL SHA512 signature
179!:ext	phar
180
1810	string/t	$!			DCL command file
182
183# Type: Pdmenu
184# URL:  https://packages.debian.org/pdmenu
185# From: Edward Betts <edward@debian.org>
1860	string		#!/usr/bin/pdmenu	Pdmenu configuration file text
187
188# From Danny Weldon
1890	string	\x0b\x13\x08\x00
190>0x04   uleshort	<4      ksh byte-code version %d
191
192# From: arno <arenevier@fdn.fr>
193# mozilla xpconnect typelib
194# see https://www.mozilla.org/scriptable/typelib_file.html
1950	string 		XPCOM\nTypeLib\r\n\032		XPConnect Typelib
196>0x10  byte        x       version %d
197>>0x11 byte        x      \b.%d
198
1990	string/fwt	#!\ /usr/bin/env\ runghc	GHC script executable
2000	string/fwt	#!\ /usr/bin/env\ runhaskell	Haskell script executable
2010	string/fwt	#!\ /usr/bin/env\ julia	Julia script executable
202