However, I'm no more than bash. I wrote a bash script that will execute my cmake, make and C ++ executable.
This works fine if my code is not compiled, it executes the old executable and leaves me in a mess. I was hoping to output the output of make to an if statement, which only runs the executable when make is successful. I have tried many bash things from other posts here on stackoverflow. Some problems look like this: the output of make is not a string, for example:
OUTPUT = make echo $OUTPUT
gives:
[100%] Built target pcl_visualizer_demo
But does not work with:
if [`expr match "$OUTPUT" '[100%] -eq 5]; then ./pcl_visulizer_demo; fi
Not to mention that there may be several errors in this line. I also tried:
if [diff <(echo "$OUTPUT") <(echo '[100%] Built target pcl_visualizer_demo' -n]; then ./pcl_visulizer_demo; fi
Again, perhaps I am not implementing it correctly. Any help
source share