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

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -