Closed DMaendlen closed 5 years ago
Can you please show the exact command line you executed?
From earlier email from @DMaendlen, the specifics of what line 837 is in his ack.
head -n 850 /usr/bin/ack | tail -n 20
# XXX read in chunks
# XXX only do this for certain file sizes?
my $content = do {
local $/;
<$fh>;
};
$has_match = $content =~ /$re/og; # <- this is line 837
}
close $fh;
}
return $has_match;
}
sub count_matches_in_resource {
my ( $resource, $opt ) = @_;
my $nmatches = 0;
my $fh = $resource->open();
if ( !$fh ) {
Also, FYI, you can use ack's --lines
option to do that: ack --lines=830-850 /usr/bin/ack
Very nice, thank you for this.
The exact command was
for i in $(ack -l 'damait06' /); do sed -i 's/damait06/dmaendlen/g' $i; done
Goal was to replace my old username from uni.
What happens if you run ack -l 'damait06'
not inside the for loop?
Exactly the same. No output for a while, then "uninitialized value ..."
Can you narrow it down to a specific starting directory?
I have nothing to go off of here. I need you to do some narrowing down.
When I did
for i in /*; do echo "$i\n\n"; ack -l damait06 $i; done
I was able to narrow it down to /proc
A further test with just
ack -l damait06 /proc
confirmed this.
A new test with
for i in /proc/*; do echo "$i\n"; ack -l damait06 $i;done
showed, that the problem was in the numeric directories (e. g. /proc/1
) of /proc
Not sure if that helps.
What if you try to grep
through /proc?
grep -r 'damait06' /proc
results in
grep: /proc/sys/fs/binfmt_misc/register: Invalid argument
grep: /proc/sys/net/ipv4/route/flush: Permission denied
grep: /proc/sys/net/ipv6/conf/all/stable_secret: Input/output error
grep: /proc/sys/net/ipv6/conf/default/stable_secret: Input/output error
grep: /proc/sys/net/ipv6/conf/eth0/stable_secret: Input/output error
grep: /proc/sys/net/ipv6/conf/lo/stable_secret: Input/output error
grep: /proc/sys/net/ipv6/conf/sit0/stable_secret: Input/output error
grep: /proc/sys/net/ipv6/conf/wlan0/stable_secret: Input/output error
grep: /proc/sys/net/ipv6/route/flush: Permission denied
grep: /proc/sys/vm/compact_memory: Permission denied
grep: /proc/kmsg: Resource temporarily unavailable
But obviously has no problems with e. g. /proc/1
There will be no more releases of ack 2. If this is still a problem with ack 3, please make an issue there: https://github.com/beyondgrep/ack3.
Hi,
if I run
ack -l
on my whole system, I get the errorUse of uninitialized value $content in pattern match (m//) at /usr/bin/ack line 837
.I think this should be remedied.
The bug was within ack 2.14, running Perl 5.24.1 on an up-to-date gentoo.
Thank you for your time