linux - SHELL: How do I use a or operator when defining a string -
this may not possible im writing first shell script , need use regexp type operator in string (shown below)
files=tif2/name(45|79)*.pdf
is possible? or have have 2 strings.
files=tif2/name45*.pdf files=tif2/name79*.pdf
alternatives in shell globbing syntax use comma-separated list enclosed semicolons. example becomes:
files=tif2/name{45,79}*.pdf
there's a pretty nice quick reference here glob syntax supported shells.
for more esoteric bash-specific glob syntax, see http://www.gnu.org/software/bash/manual/bashref.html#shell-expansions
Comments
Post a Comment