Skip to content

Commit

Permalink
IFS SAVEIFS before for loop
Browse files Browse the repository at this point in the history
  • Loading branch information
fastrizwaan committed May 22, 2023
1 parent 832f5c2 commit f6043d1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 4 additions & 2 deletions resources/modules/script-get-selected-exe
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ script-get-selected-exe()
SOURCE "script-check-variables-loaded-or-not"
script-check-variables-loaded-or-not
unset COMMAND count SHOW_OPTION NAMES FILES RESULT search_list
SAVEIFS=${IFS}
IFS=$(echo -en "\n\b")

count=0
NAMES=()
Expand All @@ -31,6 +29,10 @@ script-get-selected-exe()
--text "Sorry, no exe found in prefix: \"${PREFIXNAME}\""
Script_Window
fi

SAVEIFS=${IFS}
IFS=$(echo -en "\n\b")

# if exe_found has value, then only change exe
for i in $(echo ${search_list}|tr '|' '\n'|sort)
do
Expand Down
6 changes: 4 additions & 2 deletions resources/modules/script-get-selected-exe-for-prefix
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ script-get-selected-exe-for-prefix()
unset RESULT
unset search_list

SAVEIFS=${IFS}
IFS=$(echo -en "\n\b")

count=0
NAMES=()
Expand All @@ -35,6 +33,10 @@ script-get-selected-exe-for-prefix()
--text "Sorry, no exe found in prefix: \"${PREFIXNAME}\""
Script_Window
fi

SAVEIFS=${IFS}
IFS=$(echo -en "\n\b")

# if exe_found has value, then only change exe
for i in $(echo ${search_list}|tr '|' '\n'|sort)
do
Expand Down
6 changes: 4 additions & 2 deletions resources/modules/script-get-selected-exes-for-shortcuts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ script-get-selected-exes-for-shortcuts()
unset LIST_OF_EXES_FOR_SHORTCUTS
unset search_list

SAVEIFS=${IFS}
IFS=$(echo -en "\n\b")

count=0
NAMES=()
Expand All @@ -37,6 +35,10 @@ echo "$search_list"
# --text "Sorry, no exe found in prefix: \"${PREFIXNAME}\""
return 1
fi

SAVEIFS=${IFS}
IFS=$(echo -en "\n\b")

# if exe_found has value, then only change exe
for i in $(echo ${search_list}|tr '|' '\n'|sort)
do
Expand Down

0 comments on commit f6043d1

Please sign in to comment.