How do you launch an application.app stored in nfs share from bash script? I need to run *.app from our NFS share where the different apps and versions are stored.

I can't get it to work as part of a bash script.

For exemple, for Sublime Text, here is the command I use to launch:

elif [ `uname` == "Darwin" ]; then
    exec open -a "/path/to/nfs/"Sublime\ Text.app" "$@"
fi


When I call my script, I get the following error:

FSPathMakeRef(/path/to/nfs/Sublime Text.app) failed with error -43.


I know the path is right. Permissions are also fine. 
I'm able to launch it with the full path exec open -a "/path/to/nfs/"Sublime\ Text.app/Contents/MacOS/"Sublime\ Text"" "$@" but then all the content of the .app folder isn't available. 

Is there another way to launch .app from command line?
The primary issue I see with your command:

exec open -a "/path/to/nfs/"Sublime\ Text.app" "$@"


Is you have used a backslash to escape a space while also quoting the command. Use one or the other, but not both, e.g.:

open -a "/path/to/nfs/Sublime Text.app"


Or:

open -a /path/to/nfs/Sublime\ Text.app


I also see no reason to use exec when the open command by itself works in this context, or from a script, e.g.:

open -a "/path/to/nfs/"Sublime Text.app" "$@"


That said though, when using the open command with the -a option you might consider using the --args option, which from its man page states, "All remaining arguments are passed to the opened application in the argv parameter to main(). These arguments are not opened or interpreted by the open tool.", thus making the command as, e.g.:

open -a "/path/to/nfs/"Sublime Text.app" --args "$@"