4 ms·
Sometimes when I'm being lazy, say for example I have a variable with some folder/file absolute path... I'll convert the slashes to spaces, and word split there
by parasense 2y ago
Sometimes when I'm being lazy, say for example I have a variable with some folder/file absolute path... I'll convert the slashes to spaces, and word split there, sending the results into the stack.
$ readarray -d '/' <<<${PWD:1:-1}
$ echo ${MAPFILE[@]}
and you get a nice list of folders you can push/pop as you wish...