1

Slow script problem

view story
linux-howto

http://www.linuxquestions.org – I have a 3.5mb text file and I run following script on it using the command: 'scriptname string1 string2' Code: #!/bin/bash export GREP_OPTIONS='color=always' GREP_COLOR='01;31' grep -in textfile.txt "$1" | grep -i "$2" | grep -i "$3" | grep -i "$4" However, when I run this file in Debian and in Arch linux, the execution is very slow. The 'top' command shows that grep is working. On Slackware the script runs fast without any delay. (All 3 distributions are on same computer) The delay is due to unused $3 and $4 variables and presence of 'color=alway (HowTos)