February 7, 201115 yr Hi guys, I run some automatic imports directly via FileMaker Server's documents folder, works fine. I'm trying to remove the files imported afterwards. But a simple RunShellScript (rm $filepath) doesn't do the job. So I'm wondering if I run a shell script via FM Server, which user will actually execute the command? It's not the logged in user in the system nor the fmsadmin, otherwise the file should be removed since both have access to the FMS Documents folder. Best, Alexander System MAC OS 10.6.6 Server FMSA 11
February 7, 201115 yr I'm not the best with Mac shell scripts, but I think this (or something like it), would save the output of whoami to a text file. Just make sure the path you are saving it to can be written to by any users. whoami > "/whoami.txt"
February 7, 201115 yr Author cool hint :-) in the terminal this works fine but using Scriptmaster with the FMServer or a FMClient I doesn't work at all, very strange... even a simple RunShellScript( "echo \"hello\" > /Volumes" & Get ( TempPath ) & "whoami.txt" ) doesn't work. In the Mac terminal it works fine..
February 8, 201115 yr That's too bad. I'm surprised that didn't work; especially since it works when running directly from the shell. Maybe the shell command is not formatted properly? Meaning, by the time it is actually processed by the shell and all string's are concatenated, and quotes escaped, the command is not valid? Perhaps you could use ScriptMasters output variables section in the bottom-left of the screen to output the value of the text string that is being sent to the shell.
February 8, 201115 yr cool hint :-) in the terminal this works fine but using Scriptmaster with the FMServer or a FMClient I doesn't work at all, very strange... even a simple RunShellScript( "echo \"hello\" > /Volumes" & Get ( TempPath ) & "whoami.txt" ) doesn't work. In the Mac terminal it works fine.. Would be better with single quote don't you think: RunShellScript( "echo 'hello' > /Volumes" & Get ( TempPath ) & "whoami.txt" )
June 8, 201213 yr Newbies Just tested this on a Lion server. I let my script send me an E-Mail with the result of the RunExecuteShell command. I always only get this a result in the E-Mail: Executed shell command: <here follows the shell command SM was supposed to execute>. This seems to be a bug.
June 8, 201213 yr Author Just tested this on a Lion server. I let my script send me an E-Mail with the result of the RunExecuteShell command. I always only get this a result in the E-Mail: Executed shell command: <here follows the shell command SM was supposed to execute>. This seems to be a bug. Did you use RunShellScript() from an old example or the newer version RunShellScript ( command ; waitForOutput ; timeout )? The new one definitely works much better for me. Grüsse ausm Süden, Alexander
July 11, 201213 yr Newbies Did you use RunShellScript() from an old example or the newer version RunShellScript ( command ; waitForOutput ; timeout )? The new one definitely works much better for me. Grüsse ausm Süden, Alexander I did use the the newest version Grüße aus Berlin M
Create an account or sign in to comment