r/bash•
kalmus

Abort script if gcc points out an error

help

Hi guys,

I'm a very beginner in terms of using bash and just made my first script:

#!/bin/bash
gcc -Wall -Werror -Wextra -pedantic main.c -o main
open main

My question is, what do I have to add that, if gcc points out an error, "open main" will not be executed?

Thanks!

Posted Feb 25, 2016, 1:35 AM UTC

13
Loading comments…