Re: dash 0.5.6.1-1, setting IFS to tab, bug?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Peter,

peter kvillegard wrote:

> test1(space)test2(tab)test3
> 
> (where the "(space)" is an actual space etc)
> then:
> 
> #!/bin/dash
> 
> cat testfile |
> while IFS='  	' read col1 col2; do    #an actual tab

In my mailreader, this shows as

	"while" SP "IFS='" SP SP HT "'" SP "read" ...

In particular, IFS contains a space and a tab.  So I would expect
"$col1" to be "test1" and "$col2" to be "test2	test3".

> echo $col1
> echo $col2

Because unquoted, $col2 is subject to word splitting.  So echo
receives arguments "test2" "test3" and separates them with a space.

> done
>
> exit 0
>
> it gives the output:
>
> test1
> test2 test3

Looks good to me. ;-)

See http://unix.org/2008edition/ for details.

Hope that helps,
Jonathan
--
To unsubscribe from this list: send the line "unsubscribe dash" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux