Bash scripting, loop through files in folder fails

前端 未结 3 393
我在风中等你
我在风中等你 2020-12-16 14:29

I\'m looping through certain files (all files starting with MOVIE) in a folder with this bash script code:

for i in MY-FOLDER/MOVIE*
do

whi

3条回答
  •  囚心锁ツ
    2020-12-16 15:11

    for file in MY-FOLDER/MOVIE*
    do
      # Skip if not a file
      test -f "$file" || continue
      # Now you know it's a file.
      ...
    done
    

提交回复
热议问题