On 04/28/2014 10:43 PM, Carlos E. R. wrote:
Nope, it doesn't. Look for yourself:
Yes it does. I wrote
while read WORD WORD2 ; do echo "$WORD" .....
Note that WORD2 It means that the shell assigns the first token to WORD and the rest of the tokens to WORD2. If you read the man page for BASH/shell it mentions this behaviour :-) <quote> read [-ers] [-a aname] [-d delim] [-i text] [-n nchars] [-N nchars] [-p prompt] [-t timeout] [-u fd] [name ...] One line is read from the standard input, or from the file descriptor fd supplied as an argument to the -u option, and the first word is assigned to the first name, the second word to the second name, and so on, with leftover words and their intervening separators assigned to the last name. In your case, with only one 'name', the first and all the rest are assigned to that. In my case the first token is assigned to the first name and all subsequent tokens to the second name. You can treat this a number of ways. One is to use "-print0" and quoting. Another is to use a non-zero value of the second token to tell you that there are spaces. However I prefer the first as it prefers file names with tabs and multiples spaces. You can also use "-printf". However a lot of the time I use "-print0" and pipe the output of find into "xargs -0". -- When you are in any contest you should work as if there were - to the very last minute - a chance to lose it. Dwight D. Eisenhower -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org