help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Octave-cvsupdate] octave-forge/main/miscellaneous/inst edit.m, 1.4,


From: Benjamin Lindner
Subject: Re: [Octave-cvsupdate] octave-forge/main/miscellaneous/inst edit.m, 1.4, 1.5
Date: Thu, 05 Oct 2006 07:42:20 +0200

> Olli Saarela skrev:
> > 
> >>   edit('editor','"C:/Program Files/Good Editor/Editor.exe" "$(cygpath 
> >> -wa $s)"')
> >>
> >> Can somebody with a windows box confirm that the quotes are needed?
> > 
> > Yes, double quotes are needed. I'm currently running 2.1.50, and the 
> > command above starts the correct editor, but it doesn't find the file. 
> > There is an error message from cygpath, and it seems $s is not
> evaluated.
> > 
> >  >> edit('editor','"C:/Program Files/Good Editor/Editor.exe" "$(cygpath 
> > -wa $s)"')
> >  >> edit foo.m
> > Usage: cygpath (-d|-m|-u|-w|-t TYPE) [-c HANDLE] [-f FILE] [options]
> NAME
> > cygpath [-ADHPSW]
> So the $(...) notation doesn't work on Cygwin?
> 
> Søren
> 
> P.S. Sorry if I'm confused but I don't have access to Cygwin.

The $(...) notation works, but since the filename of the file to be
edited is sprintf()-ed into the command string, you must use %s
instead of $s.

e.g.
edit('editor','"<path-to-editor>" $(cygpath -awl %s) &');

works under octave 2.1.73/cygwin and octave 2.9.8/cygwin

the path can be set either using 'c:/foo/bar.exe' or the cygwin-way
'/cygdrive/c/foo/bar.exe'

benjamin
-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer


reply via email to

[Prev in Thread] Current Thread [Next in Thread]