I have a c file that checks whether there is a ! in the argument given (ie ./a.out hi!) and return 0 if it does and 1 if it doesn't, which works as it's supposed to.
I need to make a bash shell file (.sh) that uses the c file to check if files in a directory contain the character, ie. if the directory has dogs!.sh fly!.c ring.txt, executing ./script.sh should return
dogs!.sh
fly!.c
But I have no idea how to do so? Can anybody help out?
}in your c file, right by theelsestatement. Yourifblock doesn't use a bracket, so when it reaches that next one it thinks you're ending themain()routine.