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

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -