Originally posted by vgolden
I have fairly large C++ program which we ported from NT. I compiled it on RedHat Linux as:
c++ -Wno-deprecated -static -o <prog_name> -x c++ *.cpp
than it is called from the shell script.
When I execute shell script from the command line C++ program runs just fine. Horever, when the same shell script run from the crontab, C++ failed with:
2831 Segmentation fault
It even not attempting to run!
Any ideas? Any help will be greatly appreciated
cron generally runs commands from the "sh" shell but when you run it from the command line it runs from whatever shell you are using. Are you using a "bang line" like "#!/bin/csh" or "#!/bin/bash"as the first line of the shell script you are trying to run? This should make the results the same whether you run under cron or the command line. (Of course, that may mean it fails under both too!)