#!/bin/bash
set -e ##错误终止
# read -p "Enter Date(dataformat: YYYYMMDD):" DATE
path1="/home/hodp/tmp_test/"
if [ ! -x $path1"$1" ]; then
echo "the path $path1"$1 "not found"||exit
fi
#目录下文件数量统计
cd /home/hodp/tmp_test/$1
cur_path=$(pwd)
count=$(ls -l *.txt|wc -l)
#echo "the directory " $cur_path "the count of files(*.txt) is "$count
echo "Contains "$count" files(*.txt) in the folder " $cur_path