Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

A way to find a bug (or explain a missuse of) realpath expansion?



hello,

The /usr shade of path will disapear from debian distribution so
right now we have:

	realpath /usr/bin /usr/bin/ /bin /bin/| sort -u
	# /usr/bin

Let's forget extra / for the moment: I can get the same result with:

	foo=( {/usr,}/bin )
	foo=( ${foo%/} )
	foo=( $foo(:A) )
	print -l ${(u)foo}
	# /usr/bin

but I don't know how to oneline it:

	foo=( {/usr,}/bin )
	print -l ${(u):-${foo%/}(:A)}
	# /usr/bin
	# /usr/bin

neither I can deal with backslashed twins.

	foo=( {/usr,}/bin{,/} ) ; print -l ">>>> setting foo" $foo
	foo=( ${foo%/} )        ; print -l ">>>> remove tailing /" $foo
	foo=( $foo(:A) )        ; print -l ">>>> realpath" $foo
	foo=( ${(u)foo} )       ; print -l ">>>> uniq" $foo

	>>>> setting foo
	/usr/bin
	/usr/bin/
	/bin
	/bin/
	>>>> remove tailing /
	/usr/bin
	/usr/bin
	/bin
	/bin
	>>>> realpath
	/usr/bin
	/usr/bin
	/bin
	/usr/bin
	>>>> uniq
	/usr/bin
	/bin

I also realize I post those kind of questions for 20 years now just
because the zsh community is friendly enough to reply again and again:
I still don't know how to give a closer look to the way zsh work to fix
it by myself. To me the next step seems to be:

* compile my own version of zsh with symbols (from apt source and
  dpkg-buildpackage?)
* run a gdb session and start to explore the code

Is it? is there still something easier to try at this point? I want to
learn fishery.

regards,
-- 
Marc Chantreux
Pôle CESAR (Calcul et services avancés à la recherche)
Université de Strasbourg
14 rue René Descartes,
BP 80010, 67084 STRASBOURG CEDEX
03.68.85.60.79





Messages sorted by: Reverse Date, Date, Thread, Author