[Top][All Lists]

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

Re: some variable level issues

From: Chet Ramey
Subject: Re: some variable level issues
Date: Mon, 30 Jun 2008 08:28:28 -0400
User-agent: Thunderbird (Macintosh/20080421)

Matt Zyzik wrote:
1. I noticed bash variables don't support null characters (0x00). This is 
unlike perl and other languages. Will this ever change? Have people requested 
or wanted this feature?

Probably not; it would require considerable reworking of the variable

2. $(<file) is very useful; however, there are times when I don't want any newlines chopped 
off. So to remedy this, I do the following: "IFS='' read -r -d '' var < file". 
Firstly, is this safe to do, and are there any other ways? Secondly, it appears to be very slow 
compared to $(<file). Any thoughts?

Probably.  There will be a new builtin in bash-4.0 that will allow you to
do this more easily.

3. The "+=" operator in bash seems to be slow. For instance, with my benchmarks, it is 
hundreds of times slower than ".=" in perl. Thoughts?

I will gladly accept performance improvements.

4. In korn shell I can put two tab characters in IFS, so that the shell treats 
each tab as a field delimiter (even successive ones). Will this ever be in bash?

This is incompatible with the Posix field splitting rules; bash will
most likely never do things this way, even as an option.

``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]