我有一个小脚本,我需要从第一个句点('.')中去掉所有内容。
我用
${i%.*}
#!/bin/bash
today=$(date +"%Y%m%d")
limdir="/some/dir/"
cd $limdir || exit
for i in *Limit*${today}.csv
do
echo $i
echo /var/tmp/casper/${i%.*}
done
从上一个时期开始就失去了一切。
casper1LimitChanges.20180813.csv
/var/tmp/bin/script/xenon/casper1LimitChanges.20180813
casper1LimitSnapshot.20180813.csv
/var/tmp/bin/script/xenon/casper1LimitSnapshot.20180813
我要第一节课的所有东西。文件需要如下所示:
casper1LimitChanges.20180813.csv
/var/tmp/bin/script/xenon/casper1LimitChanges
casper1LimitSnapshot.20180813.csv
/var/tmp/bin/script/xenon/casper1LimitSnapshot