Bash for loop with wildcards and hidden files

后端 未结 4 1659
Happy的楠姐
Happy的楠姐 2020-12-10 00:41

Just witting a simple shell script and little confused:

Here is my script:

% for f in $FILES; do echo \"Processing $f file..\"; done
<
4条回答
  •  萌比男神i
    2020-12-10 01:15

    FILES=".bash*" works because the hidden files name begin with a .

    FILES="bash*" doesn't work because the hidden files name begin with a . not a b

    FILES="*bash*" doesn't work because the * wildcard at the beginning of a string omits hidden files.

提交回复
热议问题