Skip to content

Commit 7e423c2

Browse files
committed
Add remove_dup_dirs script
1 parent bfed5f5 commit 7e423c2

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

scripts/remove_dup_dirs.sh

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#! /bin/bash
2+
3+
# ------------------------------------------------------------------------------
4+
# remove_dup_dirs.sh
5+
# published as part of https://github.com/pConst/basic_verilog
6+
# Konstantin Pavlov, [email protected]
7+
# ------------------------------------------------------------------------------
8+
9+
# Utility script to iterate through all subdirectories in the working directory
10+
# and try to find duplicate subdirectories in selected location.
11+
# Duplicate subdirs in selected location will be removed
12+
13+
shopt -s nullglob
14+
15+
for dir in */
16+
do
17+
#echo "-- Inspecting $dir"
18+
19+
if [ -d "$1$dir" ]; then
20+
#echo "= $1$dir"
21+
rm -rfv $1$dir
22+
else
23+
echo "unique"
24+
fi
25+
26+
done

0 commit comments

Comments
 (0)