Add a New Comment (Rich Markup)
> Well that's a design option which we don't take. We quote them, for several reasons, including user security. IOW the tool is operating as intended here.
Can you elaborate, on the security benefits of not outputting tabs to the terminal? Especially as this is easily circumvented using `cat` I don't see the benefit. I would be happy to learn here. Anyway, I do suggest adding this to the documentation. I would also be glad with an answer of "good idea, why don't you implement it?", but I don't understand this answer.
> Output piped via `cat` should be identical to direct terminal output.
Well that's a design option which we don't take. We quote them, for several reasons, including user security. IOW the tool is operating as intended here.
The second call to `locate` should have `/path/to/locate` as well, of course. I used the exact same executable (4.6.0).
Version: 4.6.0 What I am trying to do: I added size information after a tab character at the end of each locatedb entry (this allows me to use locate to find files by size). The exact command lines I was using: (up to absolute paths)
$ mkdir test-locatedb && cd test-locatedb $ touch a b c d e f g $ du -a | awk -v 'OFS=\t' '{print $2,$1}' | /path/to/frcode > test.locatedb $ /path/to/locate --database=test.locatedb a ./test.locatedb?1 ./a?1 $ locate --database=test.locatedb a | cat ./a 1 ./test.locatedb 1 $ /path/to/locate --version locate (GNU findutils) 4.6.0 ...
What I expected to happen: I expect the tab character to be displayed when `locate` outputs results to the terminal. What did happen: `locate` replaces tabs with question marks ("?") More information: Output piped via `cat` should be identical to direct terminal output. Alternatively, the behavior should be documented in the `man` page. Relevant code:
(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)
Attach Files: Comment:
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Only logged-in users can vote.
Please enter the title of George Orwell's famous dystopian book (it's a date):
Follow 4 latest changes.
Copyright © 2023 Free Software Foundation, Inc. Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved. The Levitating, Meditating, Flute-playing Gnu logo is a GNU GPL'ed image provided by the Nevrax Design Team. Source Code
Powered by Savane 3.11