8
我試圖運行的shell腳本NSTask用下面的代碼:與NSTask運行shell腳本引起的posix_spawn錯誤
NSTask *task = [[NSTask alloc] init];
[task setLaunchPath:@"/Users/username/connect.sh"];
[task launch];
,但我得到An uncaught exception was raised
和Couldn't posix_spawn: error 8
如果我只是運行該腳本在終端,一切正常。
這裏是腳本包含:
if [ ! -d ~/Remote/username/projects ]
then
sshfs -C -p 22 [email protected]:/home/username ~/Remote/username
fi