JAVA-21776 Renamed module names
This commit is contained in:
3
linux-bash-modules/linux-bash-loops/README.md
Normal file
3
linux-bash-modules/linux-bash-loops/README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
### Relevant Articles:
|
||||
|
||||
- [Linux Commands – Looping Through Directories](https://www.baeldung.com/linux/loop-directories)
|
||||
9
linux-bash-modules/linux-bash-loops/src/main/bash/find_directories.sh
Executable file
9
linux-bash-modules/linux-bash-loops/src/main/bash/find_directories.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
find . -maxdepth 1 -mindepth 1 -type d -printf '%f\n'
|
||||
|
||||
find . -maxdepth 1 -mindepth 1 -type d | while read dir; do
|
||||
echo "$dir"
|
||||
done
|
||||
|
||||
find . -maxdepth 1 -type d -exec echo {} \;
|
||||
11
linux-bash-modules/linux-bash-loops/src/main/bash/loop_directories.sh
Executable file
11
linux-bash-modules/linux-bash-loops/src/main/bash/loop_directories.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
for dir in */; do
|
||||
echo "$dir"
|
||||
done
|
||||
|
||||
for file in *; do
|
||||
if [ -d "$file" ]; then
|
||||
echo "$file"
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user