On Thursday 28 September 2006 10:22, Jan Engelhardt wrote:
If people would always use -print0 the first time, or when filenames with spaces are expected, the world would not break as much. Of
If people use -print0 then they're writing unportable scripts. If you ever administer, e.g., a Solaris machine, you'll find out that all of the niceties of the GNU tools don't exist in non-GNU versions of those tools. e.g., -print0 and -0. Yes, there are companies at which you can't simply install GNU versions of the tools to replace the brain-deaded system-supplied ones. (Try working in the IT department of a bank and you'll see what i mean.) Conventionally speaking, whitespace in filenames causes all sorts of problems with command-line tools. Not just with find/xargs, but all sorts of tools. In some complex cases, like embedding shell code within makefiles which themselves generate more shell code, properly quoting whitespace-containing strings is problematic. When a long-time Solaris user moves to Linux, his world opens up (in more ways than one) because the tools he's used to are [almost] all there but they get more powerful. When a long-time Linux user moves to non-Linux, Unix-like OSes, the world gets a lot smaller (and a lot of his shell scripts break). As some anonymous person once put it so well: "They say that moving from Windows to Unix is difficult. Sure, but moving from Unix to Windows is impossible!" -- ----- stephan@s11n.net http://s11n.net "...pleasure is a grace and is not obedient to the commands of the will." -- Alan W. Watts