zsh-users
 help / color / mirror / code / Atom feed
* A way to find a bug (or explain a missuse of) realpath expansion?
@ 2024-04-30 13:58 Marc Chantreux
  2024-05-01  3:43 ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Marc Chantreux @ 2024-04-30 13:58 UTC (permalink / raw)
  To: Zsh Users

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



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-05-02 16:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-30 13:58 A way to find a bug (or explain a missuse of) realpath expansion? Marc Chantreux
2024-05-01  3:43 ` Bart Schaefer
2024-05-02  8:06   ` Marc Chantreux
2024-05-02 16:03     ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).