0
When trying to search for a pattern in files of current and subfolders, the grep
command is stuck in an infinite loop.
The following illustrates the problem:
/results/log/check_log: if ($f1 eq 'dump') {
/results/work/log/check_log: if ($f1 eq 'dump') {
/results/work/work/log/check_log: if ($f1 eq 'dump') {
/results/work/work/work/log/check_log: if ($f1 eq 'dump') {
/results/work/work/work/work/log/check_log: if ($f1 eq 'dump') {
/results/work/work/work/work/work/log/check_log: if ($f1 eq 'dump') {
/results/work/work/work/work/work/work/log/check_log: if ($f1 eq 'dump') {
/results/work/work/work/work/work/work/work/log/check_log: if ($f1 eq 'dump') {
Update: Adding the command used for reference.
sh -c 'grep --exclude=\*.{lst,txt} -srF dump *'
I am not quite sure what is causing this issue. I had searched in SOF and other forums, but this kind of infinite loop issue couldn't be found.
Any help in identifying the cause is much appreciated.
Possible loop in the file system (link somewhere to some parent directory). But where is grep involved? What is the exact command you used? – xenoid – 2018-10-10T09:15:55.867
1
ls -ld /results/work
, please? – user1686 – 2018-10-10T10:13:06.923As if
/results/work
pointed to/results
somehow. Investigate this. In my Debiangrep -r
doesn't follow symlinks,grep -R
does; yourgrep
may vary (neither option is POSIX). What filesystem is this? Is it healthy? – Kamil Maciorowski – 2018-10-10T10:14:07.913