Subject: bug#24025: closed (Re: grep usage question)

From: [email-masked] (GNU bug Tracking System)
Date: Sat, 24 Sep 2016 21:39:02 +0000

Your bug report

#24025: grep usage question

which was filed against the grep package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
24025: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=24025
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: grep usage question
From: Paul Eggert <[email-masked]>
To: Leroy Harrill <[email-masked]>
Cc: [email-masked]
Date: Sat, 24 Sep 2016 14:38:04 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

No further comment and it has been a couple of months, so closing the bug report.

From: Leroy Harrill <[email-masked]>
To: [email-masked]
Date: Tue, 19 Jul 2016 08:11:09 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

I am not sure if this is a bug or not. Her is an example of my script that
I am running.

#!/bin/bash

rm -f x.txt
rm -f new_file

i=1
wc -l file1 | sed 's/file1//g' >> x.txt

x=$(<x.txt)

while [ $i -le $x ]
do
            #echo "$i"
         A=$( awk -v var="$i" 'NR==var {print}' file1)
        #ack -k file1 file2 --match $A >> new_file
        grep $A some_file.txt
    ((i++))

done

grep does not appear to be grepping inside of the while loop. When I
initialize a variable directly from the command line and write the same
script it works no problem, any help on this matter would be greatly
appreciated.