Closed HaleTom closed 5 years ago
Ok, this is interesting. I do see your use case and I think it's a valid one that we should support.
Could this have something to do with a subshell dilemma?
Also, bit confused here, this might just show my current knowledge distance from scm_breeze's internals, but the following functions as such, sanity check me?
$ mkdir -p empty && touch empty/file && cd empty
$ ls_with_file_shortcuts
-rw-r--r-- 1 ghthor ghthor 0 Aug 24 11:03 [1] file
$ env | grep ^e1=
e1=/home/ghthor/.scm_breeze/empty/file
$ mkdir -p nested && touch nested/empty_file
$ ls_with_file_shortcuts
drwxr-xr-x 1 ghthor ghthor 20 Aug 24 11:04 [1] nested
-rw-r--r-- 1 ghthor ghthor 0 Aug 24 11:03 [2] file
$ env | grep ^e1=
e1=/home/ghthor/.scm_breeze/empty/nested/nested
$ exec_scmb_expand_args ls_with_file_shortcuts 1
-rw-r--r-- 1 ghthor ghthor 0 Aug 24 11:04 [1] empty_file
$ env | grep ^e1=
e1=/home/ghthor/.scm_breeze/empty/nested/empty_file
So the use case for this is like a nested recursive expansion. Question, if you make your alias into a shell function does it work?
function ls_recursive_expand() {
exec_scmb_expand_args ls_with_file_shortcuts ${@} | grcat conf.ls
}
Yup, good call on the subshell setting variables not available to the parent.
quickfix: brew install coreutils
exec_scmb_expand_args ls_with_file_shortcuts
doesn't set$e
\<number> variables when the command's output is piped:My use case for this is:
This uses the Generic Colouriser
grc
to colour the output ofll
.