Enhanced -find testing by operators -not, -or, -and, (, ), -if, -else, -endif
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
.\" First parameter, NAME, should be all caps
|
||||
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
|
||||
.\" other parameters are allowed: see man(7), man(1)
|
||||
.TH XORRISO 1 "Apr 18, 2009"
|
||||
.TH XORRISO 1 "Apr 21, 2009"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\"
|
||||
.\" Some roff macros, for reference:
|
||||
@ -1162,7 +1162,7 @@ The reserved filter name "--remove-all-filters" revokes filtering. This will
|
||||
revoke eventual suffix renamings as well. Use "--remove-all-filters+" to
|
||||
prevent any suffix renaming.
|
||||
.br
|
||||
Builtin filters are "--zisofs" and "--zisofs-decode". The former is to be
|
||||
Built-in filters are "--zisofs" and "--zisofs-decode". The former is to be
|
||||
applied via -set_filter, the latter is automatically applied if zisofs
|
||||
compressed content is detected with a file when loading the ISO image.
|
||||
.br
|
||||
@ -1207,185 +1207,168 @@ where "A0" is year 2000, "B0" is 2010, etc.
|
||||
\fB\-alter_date_r\fR type timestring iso_rr_path [***]
|
||||
Like -alter_date but affecting all files below eventual directories.
|
||||
.TP
|
||||
\fB\-find\fR iso_rr_path [test [test ...]] [-exec action [params]] --
|
||||
A very restricted substitute for shell command find in the ISO image.
|
||||
\fB\-find\fR iso_rr_path [test [op] [test ...]] [-exec action [params]] --
|
||||
A restricted substitute for shell command find in the ISO image.
|
||||
It performs an action on matching file objects at or below iso_rr_path.
|
||||
.br
|
||||
If not used as last command in the line then the argument list
|
||||
needs to get terminated by "--".
|
||||
.br
|
||||
Tests are optional. If they are omitted then action is applied to all file
|
||||
objects. If tests are given then action is applied only if all of them
|
||||
match the file object. Available tests are:
|
||||
objects. If tests are given then they form together an expression.
|
||||
The action is applied only if the expression matches the file object. Default
|
||||
expression operator between tests is -and, i.e. the expression matches only
|
||||
if all its tests match.
|
||||
.br
|
||||
-name pattern
|
||||
Available tests are:
|
||||
.br
|
||||
\fB\-name\fR pattern :
|
||||
Pattern is not expanded but used for comparison with
|
||||
the particular file names of the eventual directory tree underneath
|
||||
iso_rr_path.
|
||||
.br
|
||||
-type type_letter
|
||||
.br
|
||||
matches only files files of the given type:
|
||||
\fB\-type\fR type_letter :
|
||||
Matches files files of the given type:
|
||||
"block", "char", "dir", "pipe", "file", "link", "socket", "eltorito",
|
||||
"Xotic" which eventually matches what is not matched by the other types.
|
||||
.br
|
||||
Only the first letter is interpreted. E.g.: -find / -type d
|
||||
.br
|
||||
-damaged
|
||||
.br
|
||||
matches only files which use data blocks marked as damaged by a previous
|
||||
\fB\-damaged\fR :
|
||||
Matches files which use data blocks marked as damaged by a previous
|
||||
run of -check_media. The damage info vanishes when a new ISO image gets
|
||||
loaded.
|
||||
.br
|
||||
-undamaged
|
||||
\fB\-pending_data\fR :
|
||||
Matches files which get their content from outside the loaded ISO image.
|
||||
.br
|
||||
matches only files which use data blocks outside the areas marked as damaged.
|
||||
\fB\-lba_range\fR start_lba block_count :
|
||||
Matches files which use data blocks within the range of start_lba
|
||||
and start_lba+block_count-1.
|
||||
.br
|
||||
-lba_range start_lba block_count
|
||||
\fB\-has_acl\fR :
|
||||
Matches files which have a non-trivial ACL.
|
||||
.br
|
||||
matches only files which use data blocks within the range of start_lba
|
||||
and start_lba+block_count-1. A negative start_lba matches those files which
|
||||
would not match the range given by its positive counter part.
|
||||
\fB\-has_xattr\fR :
|
||||
Matches files which have xattr name-value pairs from user namespace.
|
||||
.br
|
||||
-has_acl , -has_no_acl
|
||||
\fB\-has_aaip\fR :
|
||||
Matches files which have ACL or any xattr.
|
||||
.br
|
||||
match files which have resp. have not a non-trivial ACL.
|
||||
\fB\-has_filter\fR :
|
||||
Matches files which are filtered by -set_filter.
|
||||
.br
|
||||
-has_xattr , -has_no_xattr
|
||||
\fB\-decision\fR "yes"|"no" :
|
||||
If this test is reached then the evaluation ends immediatly and action
|
||||
is performed if the decision is not "no", "0", or "false". See operator -if.
|
||||
.br
|
||||
match files which have resp. have not xattr name-value pairs
|
||||
from user namespace.
|
||||
Available operators are:
|
||||
.br
|
||||
-has_aaip , -has_no_aaip
|
||||
\fB\-not\fR :
|
||||
Matches if the next test or sub expression does not match.
|
||||
Several tests do this specifically:
|
||||
.br
|
||||
match files which have ACL or any xattr resp. have neither of them.
|
||||
-undamaged, -lba_range with negative start_lba, -has_no_acl, -has_no_xattr,
|
||||
-has_no_aaip, -has_no_filter
|
||||
.br
|
||||
-has_filter , -has_no_filter
|
||||
\fB\-and\fR :
|
||||
Matches if both neighboring tests or expressions match.
|
||||
.br
|
||||
match files which are filtered by -set_filter resp. are not.
|
||||
\fB\-or\fR :
|
||||
Matches if at least one of both neighboring tests or expressions matches.
|
||||
.br
|
||||
\fB\-sub\fR ... \fB\-subend\fR :
|
||||
Enclose a sub expression which gets evaluated first before it
|
||||
is processed by neighboring operators. The same meaning have "(" and ")".
|
||||
.br
|
||||
Normal precedence is: -not, -or , -and.
|
||||
.br
|
||||
\fB\-if\fR ... \fB\-then\fR\ ... \fB\-elseif\fR ... \fB\-then\fR ...
|
||||
\fB\-else\fR ... \fB\-endif\fR :
|
||||
Enclose one or more sub expressions. If the -if expression matches, then
|
||||
the -then expression is evaluated as the result of the whole expression
|
||||
up to -endif. Else the next -elseif expression is evaluated and eventually
|
||||
its -then expression. Finally in case of no match, the -else expression
|
||||
is evaluated.
|
||||
There may be more than one -elseif. Neither -else nor -elseif are mandatory.
|
||||
If -else is missing and would be hit, then the result is a non-match.
|
||||
.br
|
||||
-if expressions are the main use case for the test -decision.
|
||||
|
||||
Default action is "echo",
|
||||
Default action is \fBecho\fR,
|
||||
i.e. to print the address of the found file. Other actions are certain
|
||||
xorriso commands which get performed on the found files. These commands
|
||||
may have specific parameters. See also their particular descriptions.
|
||||
.br
|
||||
"chown" and "chown_r" change the ownership and get the user id as param. E.g.:
|
||||
\fBchown\fR and \fBchown_r\fR change the ownership and get the user id
|
||||
as parameter. E.g.: -exec chown thomas --
|
||||
.br
|
||||
-find / -exec chown thomas --
|
||||
\fBchgrp\fR and \fBchgrp_r\fR change the group attribute and get the group id
|
||||
as paramieter. E.g.: -exec chgrp_r staff --
|
||||
.br
|
||||
"chgrp" and "chgrp_r" change the group attribute and get the group id as param.
|
||||
E.g.:
|
||||
\fBchmod\fR and \fBchmod_r\fR change access permissions and get a mode string
|
||||
as parameter. E.g.: -exec chmod a-w,a+r --
|
||||
.br
|
||||
-find / name 'news*' -type d -exec chgrp_r staff --
|
||||
\fBalter_date\fR and \fBalter_date_r\fR change the timestamps. They get a type
|
||||
character and a timestring as parameters.
|
||||
.br
|
||||
"chmod" and "chmod_r" change access permissions and get a mode string as param.
|
||||
E.g.:
|
||||
E.g.: -exec alter_date "m" "Dec 30 19:34:12 2007" --
|
||||
.br
|
||||
-find / -exec chmod a-w,a+r --
|
||||
\fBlsdl\fR prints file information like shell command ls -dl.
|
||||
.br
|
||||
"alter_date" and "alter_date_r" change the timestamps.
|
||||
They get a type character and a timestring as params.
|
||||
E.g.:
|
||||
\fBcompare\fR performs command -compare with the found file address as
|
||||
iso_rr_path and the corresponding file address below its argument
|
||||
disk_path_start. For this the iso_rr_path of the -find command gets
|
||||
replaced by the disk_path_start.
|
||||
.br
|
||||
-find / -exec alter_date "m" "Dec 30 19:34:12 2007" --
|
||||
E.g.: -find /thomas -exec compare /home/thomas --
|
||||
.br
|
||||
"lsdl" prints file information like shell command ls -dl.
|
||||
E.g.:
|
||||
\fBupdate\fR performs command -update with the found file address as
|
||||
iso_rr_path. The corresponding file address is determined like with above
|
||||
action "compare".
|
||||
.br
|
||||
-find / -exec lsdl --
|
||||
\fBrm\fR removes the found iso_rr_path from the image if it is not a directory
|
||||
with files in it. I.e. this "rm" includes "rmdir".
|
||||
.br
|
||||
"compare" performs command -compare with the found file address as iso_rr_path
|
||||
and the corresponding file address below its argument disk_path_start. For this
|
||||
the iso_rr_path of the -find command gets replaced by the disk_path_start.
|
||||
E.g.:
|
||||
\fBrm_r\fR removes the found iso_rr_path from the image, including whole
|
||||
directory trees.
|
||||
.br
|
||||
-find / -exec compare /home/thomas --
|
||||
.br
|
||||
"update" performs command -update with the found file address as iso_rr_path.
|
||||
The corresponding file address is determined like with above "compare".
|
||||
.br
|
||||
E.g.:
|
||||
.br
|
||||
-find / -exec update /home/thomas --
|
||||
.br
|
||||
"rm" removes the found iso_rr_path from the image if it is not a directory with
|
||||
files in it. I.e. this "rm" includes "rmdir".
|
||||
.br
|
||||
E.g.:
|
||||
.br
|
||||
-find / -name *.doc -exec rm --
|
||||
.br
|
||||
"rm_r" removes the found iso_rr_path from the image, including whole directory
|
||||
trees.
|
||||
.br
|
||||
E.g.:
|
||||
.br
|
||||
-find /uh/oh -name *private* -exec rm_r --
|
||||
.br
|
||||
"report_damage" classifies files whether they hit a data block that is
|
||||
\fBreport_damage\fR classifies files whether they hit a data block that is
|
||||
marked as damaged. The result is printed together with the eventual address
|
||||
of the first damaged byte, the maximum span of damages, file size, and the
|
||||
path of the file.
|
||||
.br
|
||||
E.g.:
|
||||
.br
|
||||
-find / -damaged -exec report_damage --
|
||||
.br
|
||||
"report_lba" prints files which are associated to image data blocks.
|
||||
\fBreport_lba\fR prints files which are associated to image data blocks.
|
||||
It tells the logical block address, the block number, the byte size,
|
||||
and the path of each file. There may be reported more than one
|
||||
line per file if the file is very large. In this case each line has a
|
||||
different extent number in column "xt".
|
||||
.br
|
||||
E.g.:
|
||||
\fBgetfacl\fR prints access permissions in ACL text form to the result channel.
|
||||
.br
|
||||
-find / -lba_range 302000 50000 -exec report_lba --
|
||||
.br
|
||||
"getfacl" prints access permissions in ACL text form to the result channel.
|
||||
.br
|
||||
E.g.:
|
||||
.br
|
||||
-find / -has_acl -exec getfacl
|
||||
.br
|
||||
"setfacl" attaches ACLs after removing eventually exiting ones. The new
|
||||
\fBsetfacl\fR attaches ACLs after removing eventually exiting ones. The new
|
||||
ACL is given in text form as defined with option -setfacl.
|
||||
.br
|
||||
E.g.:
|
||||
E.g.: -exec setfacl u:lisa:rw,u::rw,g::r,o::-,m::rw --
|
||||
.br
|
||||
-find /work -exec setfacl u:lisa:rw,u::rw,g::r,o::-,m::rw --
|
||||
\fBgetfattr\fR prints eventual xattr name-value pairs to the result channel.
|
||||
.br
|
||||
"getfattr" prints eventual xattr name-value pairs to the result channel.
|
||||
\fBsetfattr\fR sets or deletes xattr name value pairs.
|
||||
.br
|
||||
E.g.:
|
||||
E.g.: -find / -has_xattr -exec setfattr --remove-all '' --
|
||||
.br
|
||||
-find / -has_xattr -exec getfattr --
|
||||
\fBset_filter\fR applies or removes filters.
|
||||
.br
|
||||
"setfattr" sets or deletes xattr name value pairs.
|
||||
E.g.: -exec set_filter --zisofs --
|
||||
.br
|
||||
E.g.:
|
||||
\fBshow_stream\fR shows the content stream chain of a data file.
|
||||
.br
|
||||
-find / -has_xattr -exec setfattr --remove-all '' --
|
||||
.br
|
||||
"set_filter" applies or removes filters (see -external_filter).
|
||||
.br
|
||||
E.g.:
|
||||
.br
|
||||
-find / -type f -exec set_filter gzip --
|
||||
.br
|
||||
"show_stream" shows the content stream chain of a data file.
|
||||
.br
|
||||
E.g.:
|
||||
.br
|
||||
-find / -type f -exec show_stream --
|
||||
.br
|
||||
"find" performs another run of -find on the matching file address. It accepts
|
||||
the same params as -find, except iso_rr_path.
|
||||
\fBfind\fR performs another run of -find on the matching file address.
|
||||
It accepts the same params as -find, except iso_rr_path.
|
||||
.br
|
||||
E.g.:
|
||||
.br
|
||||
-find / -name '???' -type d -exec find -name '[abc]*' -exec chmod a-w,a+r --
|
||||
.br
|
||||
If not used as last command in the line then the argument list
|
||||
needs to get terminated by "--".
|
||||
.TP
|
||||
\fB\-mkdir\fR iso_rr_path [...]
|
||||
Create empty directories if they do not exist yet.
|
||||
@ -2373,37 +2356,33 @@ Similar to shell command du -sk.
|
||||
Like -find but operating on local filesystem and not on the ISO image.
|
||||
This is subject to the settings of -follow.
|
||||
.br
|
||||
Find accepts the same -type arguments as -find. Additionally it recognizes
|
||||
type "mountpoint" (or "m"). It matches subdirectories which reside on a
|
||||
-findx accepts the same -type arguments as -find. Additionally it recognizes
|
||||
type "mountpoint" (or "m") which matches subdirectories which reside on a
|
||||
different device than their parent. It never matches the disk_path
|
||||
given as start address for -findx.
|
||||
.br
|
||||
-findx accepts the -exec actions as does -find. But except the following few
|
||||
actions it will allways perform action "echo".
|
||||
.br
|
||||
"in_iso" iso_rr_path_start reports the path if its counterpart exist in
|
||||
the ISO image. For this the disk_path of the -find command gets replaced
|
||||
by iso_rr_path_start. E.g.:
|
||||
\fBin_iso\fR reports the path if its counterpart exist in the ISO image.
|
||||
For this the disk_path of the -findx command gets replaced
|
||||
by the iso_rr_path given as parameter.
|
||||
.br
|
||||
-findx /home -exec in_iso /
|
||||
E.g.: -findx /home/thomas -exec in_iso /thomas_on_cd --
|
||||
.br
|
||||
"not_in_iso" iso_rr_path_start reports the path if its counterpart does
|
||||
\fBnot_in_iso\fR reports the path if its counterpart does
|
||||
not exist in the ISO image. The report format is the same as with command
|
||||
-compare.
|
||||
E.g.
|
||||
.br
|
||||
-findx /home/thomas -exec not_in_iso /thomas_on_cd
|
||||
.br
|
||||
"add_missing" iso_rr_path_start adds the counterpart if it does not yet
|
||||
\fBadd_missing\fR iso_rr_path_start adds the counterpart if it does not yet
|
||||
exist in the ISO image.
|
||||
E.g.
|
||||
.br
|
||||
-findx /home/thomas -exec add_missing /thomas_on_cd
|
||||
E.g.: -findx /home/thomas -exec add_missing /thomas_on_cd --
|
||||
.br
|
||||
"is_full_in_iso" iso_rr_path_start reports if the counterpart in the ISO image
|
||||
\fBis_full_in_iso\fR reports if the counterpart in the ISO image
|
||||
contains files. To be used with -type "m" to report mount points.
|
||||
.br
|
||||
"empty_iso_dir" iso_rr_path_start deletes all files from the counterpart
|
||||
\fBempty_iso_dir\fR deletes all files from the counterpart
|
||||
in the ISO image. To be used with -type "m" to truncate mount points.
|
||||
.TP
|
||||
\fB\-compare\fR disk_path iso_rr_path
|
||||
|
Reference in New Issue
Block a user