开发者

What Perl glob expression matches all the files that look like /home/test-N.txt?

开发者 https://www.devze.com 2022-12-09 11:40 出处:网络
I am a beginner to Perl syntax and ha开发者_运维问答ve a basic wildcard question. I am looking for an expression that would allow me to retrieve all of the following files.

I am a beginner to Perl syntax and ha开发者_运维问答ve a basic wildcard question. I am looking for an expression that would allow me to retrieve all of the following files.

/home/test-1.txt  
/home/test-2.txt  
/home/test-3.txt

I am just interested in the actual wildcard expression, not the file I/O.


</home/test-*.txt> should glob the files you need.

glob("/home/test-*.txt") does the same thing.

Here's a short globbing tutorial.

0

精彩评论

暂无评论...
验证码 换一张
取 消