Hacker News
new
past
comments
ask
show
jobs
points
by
sam_lowry_
15 hours ago
|
comments
by
xorcist
5 hours ago
|
[-]
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}"
reply