当前位置:网站首页>Traverse the specified directory to obtain the file name with the specified suffix (such as txt and INI) under the current directory
Traverse the specified directory to obtain the file name with the specified suffix (such as txt and INI) under the current directory
2022-06-26 13:31:00 【Cold Moon Palace leader】
#!/bin/bash
######################################################################
## ##
## Traverse the specified directory to obtain the specified suffix under the current directory ( Such as txt and ini) The name of the file ##
## ##
######################################################################
## Recursive traversal
traverse_dir()
{
filepath=$1
#echo $filepath
for file in `ls -a $filepath`
do
if [ -d ${filepath}/$file ]
then
if [[ $file != '.' && $file != '..' ]]
then
# recursive
traverse_dir ${filepath}/$file
fi
else
# Call to find the specified suffix file
check_suffix ${filepath}/$file
fi
done
}
## Get suffix txt or ini The file of
check_suffix()
{
file=$1
# if [ "${file##*.}"x = "txt"x ] || [ "${file##*.}"x = "ini"x ] || [ "${file##*.}"x = "gz"x ]; then
if [ "${file##*.}"x = "jar"x ]; then
echo $file
fi
}
# Test specified directory /data_output/ci/history
traverse_dir $(cd "$(dirname "$0")";pwd)
边栏推荐
- 三维向量的夹角
- Basic configuration and test of Beifu twincat3 NCI in NC axis interface
- 2. Introduction to parallel interface, protocol and related chips (8080, 8060)
- 7-2 the cubic root of a number
- Mediapipe gestures (hands)
- imagecopymerge
- ES基于Snapshot(快照)的数据备份和还原
- LeetCode_ Stack_ Medium_ 150. evaluation of inverse Polish expression
- MySQL explanation (I)
- 【MySQL从入门到精通】【高级篇】(二)MySQL目录结构与表在文件系统中的表示
猜你喜欢

计算两点之间的距离(二维、三维)
![8. [STM32] timer (TIM) -- interrupt, PWM, input capture experiment (proficient in timer)](/img/e7/2fd8ec8d5e5473c7f84f3e3bcedca8.png)
8. [STM32] timer (TIM) -- interrupt, PWM, input capture experiment (proficient in timer)

Guruiwat rushed to the Hong Kong stock exchange for listing: set "multiple firsts" and obtained an investment of 900million yuan from IDG capital

MediaPipe手势(Hands)

Beifu PLC realizes zero point power-off hold of absolute value encoder -- use of bias

LAMP编译安装

Stack, LIFO

橋接模式(Bridge)
![Hdu1724[Simpson formula for integral]ellipse](/img/57/fb5098e150b5f3d91a5d0983a336ee.png)
Hdu1724[Simpson formula for integral]ellipse

Mysql database explanation (III)
随机推荐
Uva5009 error curves three points
B - Bridging signals
GO语言-管道channel
ES中索引别名(alias)的到底有什么用
Gurivat sprint Harbour Exchange listed: created “multiple first”, received 900 million yuan Investment from IDG capital
Analysis of state transition diagram of Beifu NC axis
Wechat applet magic bug - choose to replace the token instead of clearing the token, wx Getstoragesync will take the old token value instead of the new token value
Beifu twincat3 can read and write CSV and txt files
原型模式(prototype)
Beifu PLC obtains system time, local time, current time zone and system time zone conversion through program
H - Sumsets POJ 2229
8、【STM32】定时器(TIM)——中断、PWM、输入捕获实验(一文精通定时器)
7-1 n queen problem
es常用语法一
HDU 3555 Bomb
Electron official docs series: Best Practices
7-2 the cubic root of a number
[how to connect the network] Chapter 2 (Part 1): establish a connection, transmit data, and disconnect
Thinking caused by the error < note: candidate expectations 1 argument, 0 provided >
Detailed practical sharing, two hours of funny videos after work, earning more than 7000 a month