Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

RunShellScript via FM Server - Who am I?

Featured Replies

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

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"

  • 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..

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.

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" )

  • 1 year later...
  • 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.

  • 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

  • 1 month later...
  • 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

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.