running commands : chmod u+x bash check.sh echo $?
It's still giving output as 1,I included the -squiggle option still,it dosen't work for me? any Ideas? #!/bin/bash CC="-I/home/swamimauli/upload/csmith/runtime/" OPTS="-Wall" TEST="bug.c" gcc ${CC} ${OPTS} ${TEST} 2>&1 | grep 'internal compiler error:in expand_expr_addr_expr_1, at expr.c:7862' if ! test $? = 0; then exit 1 fi exit 0 Thanks. Sameeran Joshi On 8/27/18, Peter Bergner <berg...@linux.ibm.com> wrote: > On 8/27/18 10:35 AM, Shubham Narlawar wrote: >> Here is the file. I am getting some error in sending .sh file, so I send >> it >> as below. >> >> #!/bin/bash >> gcc -fgnu-tm testcase.c > out.txt 2>&1 &&\ >> if >> grep 'internal compiler error' out.txt >> then >> exit 0 >> else >> exit 1 >> fi > > When I use creduce, I never write my output to an actual file, but > just pipe it directly into grep. My creduce.sh scripts usually look > like the following which have worked for me in the past. > > Peter > > > #!/bin/bash > > CC="/home/bergner/gcc/build/gcc-fsf-6-pr78543-debug/gcc/xgcc > -B/home/bergner/gcc/build/gcc-fsf-6-pr78543-debug/gcc" > OPTS="-O3 -S" > TEST=pr78543-2.i > > ${CC} ${OPTS} ${TEST} 2>&1 | grep 'internal compiler error: in push_reload, > at reload.c:1349' > if ! test $? = 0; then > exit 1 > fi > exit 0 > >