From b865ceec9035f6b7b4b22a494d3f4c0d8ec31018 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sun, 16 Apr 2017 06:50:58 +0300 Subject: add a comment about a trick It allows to safely split a string. --- fix_nt_symbol_path.sh | 2 ++ 1 file changed, 2 insertions(+) (limited to 'fix_nt_symbol_path.sh') diff --git a/fix_nt_symbol_path.sh b/fix_nt_symbol_path.sh index 92e1de0..253513b 100755 --- a/fix_nt_symbol_path.sh +++ b/fix_nt_symbol_path.sh @@ -56,6 +56,8 @@ path_contains() { local -a env_paths local env_path + # Thanks to this guy for this trick: + # http://stackoverflow.com/a/24426608/514684 IFS="$path_separator" read -a env_paths -d '' -r < <( printf -- "%s$path_separator\\0" "$env_value" ) for env_path in ${env_paths[@]+"${env_paths[@]}"}; do -- cgit v1.2.3