Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.7: Fix crash when running shell scripts from script menu UNIX
It seems that 10.7 no longer wants to run shell scripts from the script menu. This may also happen in 10.6, but I do not have an install to test it with.

No matter what script I try, the SystemUIServer crashes. And somewhere in the crash report is this ominous message:

USING_FORK_WITHOUT_EXEC_IS_NOT_SUPPORTED_BY_FILE_MANAGER

This might have something to do with Apple tightening privileges for spawning processes, but it can be easily fixed by enclosing the shell script in AppleScript.
do shell script "sh ~/script.sh"
[kirkmc adds: I haven't tested this; I don't run shell scripts from the script menu, so I haven't seen crashes.]
    •    
  • Currently 2.40 / 5
  You rated: 4 / 5 (10 votes cast)
 
[3,630 views]  

10.7: Fix crash when running shell scripts from script menu | 8 comments | Create New Account
Click here to return to the '10.7: Fix crash when running shell scripts from script menu' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.7: Fix crash when running shell scripts from script menu
Authored by: wgscott on Mar 14, '12 08:20:09AM

I never knew you could run a shell script form the Script menu (thanks for the hint), but I just tried it now in 10.7.3 and it works perfectly fine.

(I made a zsh shell script, and made the file executable, and stuck it in ~/Library/Scripts and then clicked on the file from the script menu interface).



[ Reply to This | # ]
10.7: Fix crash when running shell scripts from script menu
Authored by: V.K. on Mar 14, '12 08:42:17AM
works just fine here. you do need to make sure that your shell script starts with #!/bin/bash and the executable bit is set on it though as explained in the original hint .

[ Reply to This | # ]
10.7: Fix crash when running shell scripts from script menu
Authored by: diamondsw on Mar 14, '12 09:30:51AM

Likewise, I use shell scripts from the Script Menu commonly, and they've always worked fine. Just confirmed on 10.7.3.



[ Reply to This | # ]
10.7: Fix crash when running shell scripts from script menu
Authored by: jaydisc on Mar 14, '12 05:30:15PM

Works fine without this hint here too.



[ Reply to This | # ]
10.7: Fix crash when running shell scripts from script menu
Authored by: benwiggy on Mar 15, '12 06:28:49AM

This is not a hint. Shell scripts work as expected from the Scripts menulet in Lion.



[ Reply to This | # ]
OK, I see this issue too...
Authored by: slb on Mar 15, '12 01:38:15PM

I did all the bits correctly, but I can't launch a script from the AS menu.
I've set chmod, etc. and I can double-click it in the Finder just fine.

Tried:
!#/bin/sh and !#/bin/bash and neither work here in 10.7.3?

Other ideas? All I get in Console is this:
3/15/12 2:04:07.397 PM com.apple.SystemUIServer.agent: TERM environment variable not set.

Edited on Mar 15, '12 02:04:28PM by slb



[ Reply to This | # ]
OK, I see this issue too...
Authored by: wgscott on Mar 15, '12 09:13:34PM
You transposed the ! and # i.e., you want:
#!/bin/bash


[ Reply to This | # ]
OK, I see this issue too...
Authored by: slb on Mar 15, '12 09:39:03PM

Thanks - I wrote it here wrong, but the scripts are fine. I'm stumped. They run fine in Terminal and Finder. Just refuse to run from the /Library/Scripts folder. Thanks for the help though.



[ Reply to This | # ]