Opotoc Posted February 7, 2011 Posted February 7, 2011 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
dansmith65 Posted February 7, 2011 Posted February 7, 2011 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"
Opotoc Posted February 7, 2011 Author Posted February 7, 2011 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..
dansmith65 Posted February 8, 2011 Posted February 8, 2011 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.
bruceR Posted February 8, 2011 Posted February 8, 2011 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" )
Newbies TiGerman Posted June 8, 2012 Newbies Posted June 8, 2012 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.
Opotoc Posted June 8, 2012 Author Posted June 8, 2012 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
Newbies TiGerman Posted July 11, 2012 Newbies Posted July 11, 2012 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
Recommended Posts
This topic is 4861 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now