Originally Posted by SteveMack2015
I'm having a little trouble here - I have a php script that parses a .csv file and creates a bash script (.sh) along with a few other .txt files (not relevant). I then try to run the bash script at the end of the PHP script:
and it does nothing. After running the php script (which creates the bash script successfully), I've also tried running the bash script in terminal - again nothing.
Several things come to mind. Have you tried putting the "#!/bin/bash" as the first line of the shell script, and calling it with just the script name? Also, are the permissions on the file ok? Maybe try to call it with "system" instead of 'exec', and see what happens. Also, for debugging purposes, you could try to output the variables to a separate text file, to see what you're getting. And you mention overwriting...are you closing the file prematurely, or maybe using a file create instead of append somewhere?
Although, when I copy the contents of the bash script into a new file in XCode (I'm running OS X) and save it, overwriting the old file, then I can run the bash script in terminal and it works correctly. Doesn't make much sense to me since the file is exactly the same, just overwritten outside of the php script...
And now comes the obligatory "You know this is LINUX
questions, right?" statement, after you said you used OSX.
But this would be a better thread in the "Programming" forum.