Re: Segfault in Bash

2020-07-14 Thread Ilkka Virta
On 14.7. 16:08, Chet Ramey wrote: On 7/14/20 6:32 AM, Jeffrey Walton wrote: ./audit-libs.sh: line 17: 22929 Segmentation fault (core dumped) $(echo "$file" | grep -E "*.so$") Bash is reporting that a process exited due to a seg fault, but it is not necessarily a bash process. As a

Re: Segfault in Bash

2020-07-14 Thread Ilkka Virta
On 14.7. 13:32, Jeffrey Walton wrote: Hi Everyone, I'm working on a script to find all shared objects in a directory. A filename should match the RE '*.so$'. I thought I would pipe it to grep: IFS="" find "$dir" -name '*.so' -print | while read -r file do if ! $(echo "$file" | grep -E

Re: Segfault in Bash

2020-07-14 Thread Chet Ramey
On 7/14/20 6:32 AM, Jeffrey Walton wrote: > Hi Everyone, > > I'm working on a script to find all shared objects in a directory. A > filename should match the RE '*.so$'. I thought I would pipe it to > grep: > > $ ./audit-libs.sh /home/jwalton/tmp/ok2delete/lib > ./audit-libs.sh: line 17: 22929

Re: Segfault in Bash

2020-07-14 Thread Greg Wooledge
> > IFS="" find "$dir" -name '*.so' -print | while read -r file > > do > > if ! $(echo "$file" | grep -E "*.so$"); then continue; fi > > echo "library: $file" > > > > done Also, I forgot to point out: your "if" line is executing each of the shared libraries that you find. Every one of

Re: Segfault in Bash

2020-07-14 Thread Greg Wooledge
On Tue, Jul 14, 2020 at 06:32:44AM -0400, Jeffrey Walton wrote: > $ ./audit-libs.sh /home/jwalton/tmp/ok2delete/lib > ./audit-libs.sh: line 17: 22929 Segmentation fault (core dumped) > $(echo "$file" | grep -E "*.so$") This grep regular expression is not valid. The * symbol in a regular

Segfault in Bash

2020-07-14 Thread Jeffrey Walton
Hi Everyone, I'm working on a script to find all shared objects in a directory. A filename should match the RE '*.so$'. I thought I would pipe it to grep: $ ./audit-libs.sh /home/jwalton/tmp/ok2delete/lib ./audit-libs.sh: line 17: 22929 Segmentation fault (core dumped) $(echo "$file" | grep