bash - Deleting two characters from printf? -
using gnu find 4.4.2; confused @ how backspace .\
filename:
find -name '*' -fprintf foobar "\b\b%h%f\n"
how meant this?
backspacing purely cosmetic issue in terminal , not delete characters data.
find
prints ./
because implicitly ask search .
(by not providing path).
you can use find -printf '%p\n'
print path without search path.
you can use find *
, since makes search each (non-hidden) file in directory instead of directory itself.
as funny aside, here's how you'd literally asked for:
-printf '%h/\b\b%p\n' # not use! read context!
this translates "print search path (.
) , slash. print 2 backspaces make terminal hide them, , make programs consuming output choke. print path want."
obviously better simplified "print path want", i.e. -printf '%p\n'
Comments
Post a Comment