-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove .run.id during test cleanup (#11786)
- Loading branch information
Showing
6 changed files
with
65 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/bash | ||
|
||
if [ $# -eq 0 ]; then | ||
read -p "Enter the comma-separated list of filenames to search for: " filenames | ||
else | ||
filenames=$@ | ||
fi | ||
|
||
IFS=',' read -ra filenames_arr <<< "$filenames" | ||
|
||
# Start search from the current working directory | ||
current_dir=$(pwd) | ||
|
||
echo "Searching for files in $current_dir..." | ||
found_files=() | ||
for filename in "${filenames_arr[@]}"; do | ||
while IFS= read -r file; do | ||
found_files+=("$file") | ||
done < <(find "$current_dir" -type f -name "$filename" 2>/dev/null) | ||
done | ||
|
||
if [[ ${#found_files[@]} -eq 0 ]]; then | ||
echo "No files found." | ||
exit 0 | ||
fi | ||
|
||
echo "Found files:" | ||
for file in "${found_files[@]}"; do | ||
echo "$file" | ||
done | ||
|
||
read -p "Do you want to remove all these files? (y/n): " confirm | ||
|
||
if [[ $confirm == "yes" ]] || [[ $confirm == "y" ]]; then | ||
for file in "${found_files[@]}"; do | ||
rm "$file" | ||
done | ||
echo "Files removed." | ||
else | ||
echo "Files not removed." | ||
fi |