Yi Yan wrote:
Hi,

     I used the following Bash script to test substring replacement operator.
It is performance get worse very quickly with the increasing of the string
length.

    I test the script with Bash(4.1) on Debian Linux machine.

    See the execution time difference by increasing the $NUM in the script:


========================================
#! /usr/local/bin/bash

declare z="start"
declare NUM=1000

#----------------------------------
# create a long string with ';'
#----------------------------------
for ((i=0; i<$NUM; i++)); do
    z="$z;string$i"
done


#------------------------------
# delete everything except ';'
#------------------------------
date +%s

x="${z//[^;]}"
echo $x

date +%s


_________________________________________________________________
The New Busy is not the too busy. Combine all your e-mail accounts with Hotmail.
----
        So you did the above and what did you find out?

        (Or did I miss an email?)

Reply via email to