I want to target all files called fooxxxbarxxx
. The common thing among all those files is that it contains foo
and bar
.
I've tried to use *foo*bar*
and *foo**bar*
but it doesn't work.
Specifically, I'm trying to create soft links to those files, and the rest of the code already works for more straightforward executions (looks into all subfolders of path
):
shopt -s globstar
ln -s /path/**/*foo*bar* .
Thanks
In bash
shell you need to use extglob
option for this OR type shell expansions.
shopt -s extglob nullglob
and then do the globbing as
ln -s /path/**/@(*foo*bar*|*bar*foo*)
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다