mirror of
https://github.com/0glabs/0g-storage-node.git
synced 2025-04-01 14:06:10 +00:00
Merge 40e3ec0c41
into 74074dfa2f
This commit is contained in:
commit
71331e352d
@ -4,12 +4,12 @@ directory="$1" # The directory to search in
|
||||
filename="$2" # The filename to search for
|
||||
|
||||
# Find the file in the directory
|
||||
found_files=$(find "$directory" -type f -name "$filename")
|
||||
mapfile -t found_files < <(find "$directory" -type f -name "$filename")
|
||||
|
||||
# Check if any files were found
|
||||
if [ -z "$found_files" ]; then
|
||||
if [ ${#found_files[@]} -eq 0 ]; then
|
||||
echo "Error: No files named '$filename' found in directory '$directory'." >&2
|
||||
exit 1
|
||||
else
|
||||
echo "$found_files"
|
||||
fi
|
||||
printf "%s\n" "${found_files[@]}"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user