Organize files into categorized directories
Renamed and moved files into categorized directories for better organization. Categories include Shell-Programming, File-IO, Process-Control, and Signal-and-Piping.
This commit is contained in:
1 parent
42a79e4154
commit
b792642ee2
12 files changed
No files matched your search
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
# 清空输出文件
|
||||
>record2
|
||||
# 从 record 文件中读取每一行记录
|
||||
while read name ch math eng; do
|
||||
# 判断三个科目中是否有不及格(成绩低于 60)
|
||||
if [ "$ch" -lt 60 ] || [ "$math" -lt 60 ] || [ "$eng" -lt 60 ]; then
|
||||
echo "$name $ch $math $eng" >>record2
|
||||
fi
|
||||
done <record
|
||||
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
# 统计当前目录下的文件总数
|
||||
file_count=$(ls | wc -l)
|
||||
# 统计当前目录下的子目录数
|
||||
dir_count=$(ls -l | grep '^d' | wc -l)
|
||||
# 统计当前目录下有执行权限的普通文件数
|
||||
exec_file_count=$(ls -l | grep '^-..x' | wc -l)
|
||||
# 输出结果
|
||||
echo "当前目录下的文件总数: $file_count"
|
||||
echo "当前目录下的子目录数: $dir_count"
|
||||
echo "当前目录下有执行权限的普通文件数: $exec_file_count"
|
||||
Reference in new issue
Block a user