* A little annoiance after modifying my .bashrc file to add an alias to edit files
@ 2012-06-20 18:20 gialloporpora
2012-06-20 18:57 ` Larry Hall (Cygwin)
0 siblings, 1 reply; 3+ messages in thread
From: gialloporpora @ 2012-06-20 18:20 UTC (permalink / raw)
To: cygwin
Hi all,
I have found this good tip:
http://www.mikaelkrok.net/component/content/article/44-java/131-use-cygwin-with-your-best-external-windows-text-editor
to use my Windows text editor to modify files.
I have added this line to my .bashrc file:
alias edit="cygstart /cygdrive/c/Programmi/Crimson\ Editor/cedt.exe
"$(cygpath -w "$1")""
I have only an annoiance, not a real problem, only an annoiance: when I
start the Cygwin shell and it loads the .bashrc file, it is shown this
message:
cygpath: can't convert empty path
Is it possible to hide it without removing the tip?
Thanks
Sandro
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: A little annoiance after modifying my .bashrc file to add an alias to edit files
2012-06-20 18:20 A little annoiance after modifying my .bashrc file to add an alias to edit files gialloporpora
@ 2012-06-20 18:57 ` Larry Hall (Cygwin)
2012-06-20 23:48 ` gialloporpora
0 siblings, 1 reply; 3+ messages in thread
From: Larry Hall (Cygwin) @ 2012-06-20 18:57 UTC (permalink / raw)
To: cygwin
On 6/20/2012 2:13 PM, gialloporpora wrote:
> Hi all,
> I have found this good tip:
> http://www.mikaelkrok.net/component/content/article/44-java/131-use-cygwin-with-your-best-external-windows-text-editor
>
> to use my Windows text editor to modify files.
> I have added this line to my .bashrc file:
> alias edit="cygstart /cygdrive/c/Programmi/Crimson\ Editor/cedt.exe
> "$(cygpath -w "$1")""
> I have only an annoiance, not a real problem, only an annoiance: when I
> start the Cygwin shell and it loads the .bashrc file, it is shown this message:
> cygpath: can't convert empty path
>
> Is it possible to hide it without removing the tip?
I'm curious why you query the list for help instead of your original source.
That notwithstanding, the reason you see this is because the alias you found
and are using is wrong. From the bash man page:
There is no mechanism for using arguments in the replacement text. If
arguments are needed, a shell function should be used (see FUNCTIONS
below).
The alias you pulled from the web tries to work-around this restriction,
without much success (not surprisingly). Use a function something like
this:
edit ()
{
cygstart "/cygdrive/c/Programmi/Crimson\ Editor/cedt.exe" $(cygpath -w
"$*")
}
--
Larry
_____________________________________________________________________
A: Yes.
> Q: Are you sure?
>> A: Because it reverses the logical flow of conversation.
>>> Q: Why is top posting annoying in email?
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: A little annoiance after modifying my .bashrc file to add an alias to edit files
2012-06-20 18:57 ` Larry Hall (Cygwin)
@ 2012-06-20 23:48 ` gialloporpora
0 siblings, 0 replies; 3+ messages in thread
From: gialloporpora @ 2012-06-20 23:48 UTC (permalink / raw)
To: cygwin
Risposta al messaggio di Larry Hall (Cygwin) :
> I'm curious why you query the list for help instead of your original source.
Since, I suppose that the author doesn't know the answer, because I
suppose, that if he knew the answer would have written it directly in
article. In past I have always asked in this newsgroup for Cygwin
related problems, always with good and satisfactory answers, like in
this occasion
And asking in newsgroup I could easily save the thread archiving it in TB.
> That notwithstanding, the reason you see this is because the alias you found
> and are using is wrong. From the bash man page:
>
> There is no mechanism for using arguments in the replacement text. If
> arguments are needed, a shell function should be used (see FUNCTIONS
> below).
>
> The alias you pulled from the web tries to work-around this restriction,
> without much success (not surprisingly). Use a function something like
> this:
>
> edit ()
> {
> cygstart "/cygdrive/c/Programmi/Crimson\ Editor/cedt.exe" $(cygpath -w
> "$*")
Thank you very much Larry for you explanation, it works perfectly
Exactly what I am searching for
Sandro
--
Sto ascoltando: *The Rolling Stones – Salt Of The Earth * -
http://bit.ly/MEuiyc
Two things are infinite: the universe and human stupidity; and I'm not
sure about the universe.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-06-20 23:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-20 18:20 A little annoiance after modifying my .bashrc file to add an alias to edit files gialloporpora
2012-06-20 18:57 ` Larry Hall (Cygwin)
2012-06-20 23:48 ` gialloporpora
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).