At the moment, the -ls and -fls actions always quote 'unprintable' characters, supposedly for compatibility with 'ls' itself. However, 'ls' only actually does this if stdout is a terminal.
There is a tension then between aligning the behaviour of -ls with the actual 'ls' in GNU coreutils, and preserving existing functionality. The specific problem area would be if people have written programs which rely on '-ls' and '-fls' always escaping their output even if the otuput is to a plain file or pipe. There is a second and somewhatr related problem. Since sometime in the 4.2.x series, -print, -fprint, -printf and -fprintf started quoting their ouptut if it was going to a terminal. Unfortunately this was done via a gnulib gunction 'print_quoted'. The 'print_quoted' function works very well but the fact is that it is different to the result you get from '-ls'. I'm considering rationalising this situation somewhat. However, there is a ground rule: if a change is made, the output find produces will be the same before and after the change, where the output is going to a plain file (or any other file which is not a terminal). This means that I'm considering changing the output quoting method for -ls and -print where the output goes to a tty. Should I also consider changing -ls and -fls to just print the literal pathname if the output is going to a non-terminal? Or, should I leave things as they are, on the grounds that the current behaviour doesn't seem to be hurting anybody? Your thoughts appreciated. regards, James. _______________________________________________ Bug-findutils mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-findutils
