Bash if 语句相关

for filename in `ls $foldpath`
do
  if [[  $filename =~ .*_raw_.*\.csv  ]] # find the file with name like 'sss_raw_df.csv'
  then 
    #do process
  fi
done

if [ -d $filepath ] #check if the filepath is a fold
if [ -f $filepath ] # check if the filepath is a file
if [ -e $filepath ] # check if the path is exist

你可能感兴趣的:(Bash if 语句相关)