Use `find … -delete` to remove file with pattern

This commit is contained in:
Jeremy Gardais 2021-01-28 11:27:19 +01:00
parent 9617abc968
commit 3126864255
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 4 additions and 2 deletions

View File

@ -374,7 +374,8 @@ is_queue_disable() { # {{{
return_queue_disable="1"
## Ensure to remove any previously setted file
rm -f -- "${sge_queue_flag_file}"
# shellcheck disable=SC2086
find ${sge_queue_flag_file} -delete
;;
3 ) ## Results (header + queue name) so the queue is disable
local_sge_queue_state="disable"
@ -507,9 +508,10 @@ for host: ${RED}${sge_hostname:=/dev/null}${COLOR_DEBUG}."
## If the queue(s) are already enable
### Ensure to remove any potential flag file
# shellcheck disable=SC2086
### Exit
is_all_queue_enable "${sge_hostname}" "${sge_queues_name}" \
&& rm -f -- "${sge_queue_flag_pattern}" \
&& find ${sge_queue_flag_pattern} -delete \
&& exit 0
## Test all queues one by one