-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Thomas Graf on 3/20/2007 7:00 PM: > description: seperator string with null bytes gives different outputs > > $ seq -s"" 1 5 > 112131415 > $ seq -s "" 1 5 > 12345 > > it looks strang for me.
Cockpit error. The argument for -s is mandatory, but by shell parsing rules, you have just invoked "seq" "-s" "1" "5". Therefore, "1" is the argument to -s, and given only one argument to seq, as if you had done 'seq --separator=1 -- 5'. Therefore, seq did what you asked, and printed from 1 through 5 (it defaults to starting at 1 when there is only one argument instead of two), with each digit also separated by the string "1". If you actually want a NUL byte as the separator in the output, you will have to do something like: $ printf '%s\0' `seq 1 5` since seq has no notion of understanding escape sequences, and since there is no way to pass NUL to an application from the command line without the use of escape sequences. - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFGAJXj84KuGfSFAYARAiAJAJ0dadSV8okxmmDJ55oNCCNjJtGZ9QCg0YcI ZhNvKDNi3TFtfQ7kFr2qgMc= =/XRu -----END PGP SIGNATURE----- _______________________________________________ Bug-coreutils mailing list [email protected] http://lists.gnu.org/mailman/listinfo/bug-coreutils
