I am trying to use the shell() function in a macro to feed a command line parameter into a bash script I have written. The script works fine if I run it interactively from a terminal window. I have harvested some knowledge regarding shell() from this and other forums, so I have managed to do some debugging, but am currently “stuck”.
At this point, I have got the macro to run the bash script and it is accepting the string that I am testing with as the input parameter. However, it seems that the bash script is running in some weird user context because I can make it write to debugging logs in my home directory, but it does not appear to have permission to execute some of the executeables that it needs to run. I tried redirecting the whoami command to my debug log so I can see what user the bash script is being executed as, but the debug log shows “/usr/bin/whoami: Permission denied”.
Is there a way to make the shell() function execute under a specific user context?