software 

the best and worst implementation of realpath I've seen:

sed '/^[^/]/s@^@'"$PWD"'/@
s@/\.\.$@/../@;s@/\(\./\)\{1,\}@/@g;:0
s@[^/][^/]*//*\.\./@/@;t 0
s@^/*\.\./@/@;s@//*@/@g;s@/\.\{0,1\}$@@;s@^$@/@'

from github.com/clvv/fasd/blob/90b5

Follow

software 

@ek wait, fasd looks amazing where has this been all my life

software 

@cosine It is amazing and I developed muscle memory for using it...

And then the code scared me too much so I rewrote it in rust, so I use pazi these days (github.com/euank/pazi).

I'm looking into the best way to bring fasd's file-path-tracking stuff into pazi too is why I'm reading this code

software 

@ek !! awesome! gotta check all these out!

Sign in to participate in the conversation
ACP 馃帀馃嵃

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!