How to check the extension of a filename in a bash script?

后端 未结 9 892
不思量自难忘°
不思量自难忘° 2020-12-04 05:33

I am writing a nightly build script in bash.
Everything is fine and dandy except for one little snag:


#!/bin/bash

for file in \"$PATH_TO_SOMEWHERE\"; d         


        
9条回答
  •  时光取名叫无心
    2020-12-04 05:56

    You can use the "file" command if you actually want to find out information about the file rather than rely on the extensions.

    If you feel comfortable with using the extension you can use grep to see if it matches.

提交回复
热议问题