Using emacsclient with custom emacs in $PATH

view full story

http://unix.stackexchange.com – I want to use emacs command as a substitution for emacsclient -c -a "", which according to man connects to an existing emacs daemon, or creates a new daemon and connects to it otherwise. So i created a shell script emacs, which calls the aforementioned command in my ~/bin, which itself is included in $PATH. But when i run emacs, it repeats the following numerously: emacsclient: can't find socket; have you started the server? To start the server in Emacs, type "M-x server-start". and then also numerously: Error: Could not start the Emacs daemon According to Emacs devs, emacsclient interna (HowTos)