commit 7fd404a4a2f2e9369205e28e61e16ddc3f575012 parent ca838c9abacf893324669c788a1a1cb950e22e20 Author: klewer-martin <martin.cachari@gmail.com> Date: Thu, 8 Apr 2021 18:47:53 -0300 Moved clean.sh from 9511_workbook repo; Diffstat:
A | clean.sh | | | 25 | +++++++++++++++++++++++++ |
1 file changed, 25 insertions(+), 0 deletions(-) diff --git a/clean.sh b/clean.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# Removes every a.out from every subfolder where the +# script is executed; + +# Set the filename; +file='a.out' + +# The path where 'file' is gonna be looked for; +subfolders=./**/$file +currentdir=./$file + +# First checks if the file exist in the current directory +# or in any sub-folder, if exist removes it from everywhere; +if [ -e $currentdir ] || [ -e $subfolders ]; +then + rm -v -f ./**/"$file" + rm -v -f "$file" + echo "everithing cleaned succesfully" + +# if doesn't exist then does nothing; +else + echo "everything seems clean" + echo "there is nothing to do" +fi