From da36d0093ffd29db03689ff277e78226ecd396b6 Mon Sep 17 00:00:00 2001 From: desktop Date: Sun, 29 Oct 2023 22:08:51 +0300 Subject: [PATCH] bash : name : fix specifying names with spaces. --- document/linux/config/bash/module/name.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/document/linux/config/bash/module/name.sh b/document/linux/config/bash/module/name.sh index e9e76c1..9480570 100644 --- a/document/linux/config/bash/module/name.sh +++ b/document/linux/config/bash/module/name.sh @@ -5,6 +5,7 @@ name() local files="$@" local count=0 local total=$# + local IFS=$'\n' # all files except hidden by default. if [[ "${files}" = "" ]]; then @@ -57,6 +58,7 @@ name_hash() local files="$@" local count=0 local total=$# + local IFS=$'\n' # all files except hidden by default. if [[ "${files}" = "" ]]; then @@ -109,6 +111,7 @@ name_hash_check() local count=0 local total=$# local failed=0 + local IFS=$'\n' # all files by default. if [[ "${files}" = "" ]]; then @@ -158,6 +161,7 @@ name_series() local files="${@:2}" local count=0 local total=$# + local IFS=$'\n' # error when no season number specified. if [[ "${season}" = "" ]]; then @@ -200,6 +204,7 @@ name_manga() local count=0 local total=$# local manga="${PWD##*/}" + local IFS=$'\n' # error when no season number specified. if [[ "${season}" = "" ]]; then @@ -241,6 +246,7 @@ name_ext() local files="${@:2}" local count=0 local total=$# + local IFS=$'\n' # error when no new extension specified. if [[ "${extension}" = "" ]]; then