From: Matthias Lederhofer Date: Thu, 02 Aug 2007 10:10:56 GMT Subject: Re: Interpreting EDITOR/VISUAL environment variables. Message-ID: <20070802101056.GA31182@moooo.ath.cx> In-Reply-To: <85r6mnrs1z.fsf@lola.goethe.zz> David Kastrup wrote: > a) Using system and shell-quoting the filename. Advantage: one can > set EDITOR='"/home/dak/My Programs/editor"' and have it work. > Disadvantage: shell-quoting a file name seems shell- and > system-dependent. What about this instead of quoting the argument? sh -c '$EDITOR "$1" "$2"' editor +5 /path/to/file (i.e. for C execvp("/bin/sh", "-c", "$EDITOR \"$1\" \"$2\"", "editor", "+5", "/path/to/file"))