Closed ithinuel closed 6 years ago
@ithinuel Very intresting. But, I can't reproduce this https://asciinema.org/a/Yah4tHSdTCoBzpiW2z3uwUYty
I will probably try to play with the IFS
var to handle paths as array.
join_path() { local IFS=/; echo "$*" }
split_path() { local IFS=/; echo "$*" } # this does not break spaces in names.
a=($(split_path 'ab cd/e/f/'))
b=($(split_path '//gh i///j/k'))
echo $#a[@] $a[1]
join_path $a $b
results in :
4 ab cd
ab cd/e/f/gh i/j/k
I'll PR once it's fixed.
how to reproduce
case 1
case 2
Hint
I have added
echo "out $_AUTOENV_OLDPATH"
on lineecho "in $_AUTOENV_OLDPATH"
on lineand this is what is reported :