문제

I want to pass an empty string to emacsclient so that it will auto-start the emacs server if it's not already running. On the command line if I type emacsclient -t -a '', this does exactly what I just described. In my bashrc file I have:

alias ec="emacsclient -t -a \'\'"

Which does not do what I want. I get this error

emacsclient: can't find socket; have you started the server?
To start the server in Emacs, type "M-x server-start".
emacsclient: error executing alternate editor "''"

How do I pass an empty string as an argument?

도움이 되었습니까?

해결책

You don't need to escape the single quotes within double quotes:

alias ec="emacsclient -t -a ''"
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top