[Top][All Lists]

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

some variable level issues

From: Matt Zyzik
Subject: some variable level issues
Date: Sun, 29 Jun 2008 19:15:17 -0400
User-agent: Mutt/1.5.11


I have a few issues to address, that I arrived at recently. None of them are 
necessarily bugs.

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?

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?

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

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?




Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: i686-pc-linux-gnu-gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL 
-DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib   -march=pentium4 -O2 -pipe
uname output: Linux ice.filescope.com #8 PREEMPT Sat Sep 8 21:30:00 
EDT 2007 i686 Intel(R) Pentium(R) 4 CPU 1400MHz GenuineIntel GNU/Linux
Machine Type: i686-pc-linux-gnu

Bash Version: 3.2
Patch Level: 39
Release Status: release

reply via email to

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