News for hackers. Stuff that matters.
Re:Programming Isn't Special by xorcist on Friday October 09, 2026 @02:42PM (#50024965)
Not to rain on your fine snippet but you can use negative offsets to index from the end of the string:

  P="$PWD"
  [ ${#P} -gt $pwdmaxlen ] && P="$trunc_symbol${P: -$pwdmaxlen}"

There are no comments on this comment yet.