* eshell: how to alias cp 'cp -i' ?
@ 2007-09-04 19:18 furue
2007-09-05 0:36 ` David Hansen
[not found] ` <mailman.329.1188952757.18990.help-gnu-emacs@gnu.org>
0 siblings, 2 replies; 10+ messages in thread
From: furue @ 2007-09-04 19:18 UTC (permalink / raw)
To: help-gnu-emacs
Hello,
I'm new to eshell and am wondering how to alias
"cp" to "cp -i". As a first step, I tried this:
~ $ alias tmpcp 'cp -i'
~ $ tmpcp tmp.eps tmp2.eps
cp: missing destination file or directory
~ $
I don't find a/the documentation (the info page
on the eshell alias is empty on my system, which
is emacs22 on the testing distribution of Debian),
or I fail to find a solution in the archive of this group
(the lastest posting which is more or less relevent
is dated 2001 or so).
I don't insist on aliases. Something like
(defun cp (args) (builtin-cp -i args))
would do, too. (I'm a lisp newbie, too, so
I'm sure that the code above is wrong.)
Thank you,
Ryo
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: eshell: how to alias cp 'cp -i' ?
2007-09-04 19:18 eshell: how to alias cp 'cp -i' ? furue
@ 2007-09-05 0:36 ` David Hansen
[not found] ` <mailman.329.1188952757.18990.help-gnu-emacs@gnu.org>
1 sibling, 0 replies; 10+ messages in thread
From: David Hansen @ 2007-09-05 0:36 UTC (permalink / raw)
To: help-gnu-emacs
On Tue, 04 Sep 2007 12:18:52 -0700 furue@hawaii.edu wrote:
> I'm new to eshell and am wondering how to alias
> "cp" to "cp -i". As a first step, I tried this:
I have the line
alias mp mplayer $*
in the file ~/.eshell/alias and it seems to be working. But I forget
how the line ended up there. Just manually adding should work.
David
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: eshell: how to alias cp 'cp -i' ?
[not found] ` <mailman.329.1188952757.18990.help-gnu-emacs@gnu.org>
@ 2007-09-05 19:46 ` Stefan Reichör
2007-09-05 23:45 ` furue
0 siblings, 1 reply; 10+ messages in thread
From: Stefan Reichör @ 2007-09-05 19:46 UTC (permalink / raw)
To: help-gnu-emacs
David Hansen <david.hansen@gmx.net> writes:
> On Tue, 04 Sep 2007 12:18:52 -0700 furue@hawaii.edu wrote:
>
>> I'm new to eshell and am wondering how to alias
>> "cp" to "cp -i". As a first step, I tried this:
>
> I have the line
>
> alias mp mplayer $*
>
> in the file ~/.eshell/alias and it seems to be working. But I forget
> how the line ended up there. Just manually adding should work.
>
> David
I have the following alias defined:
alias l 'ls -la $*'
This allows to issue commands like
l e*
I tried the following:
alias tcp 'cp -i $*'
But this didn't work. That is probably an emacs bug.
When you only want to copy one file to a destination, you can use the following:
alias tcp 'cp -i $1 $2'
Stefan.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: eshell: how to alias cp 'cp -i' ?
2007-09-05 19:46 ` Stefan Reichör
@ 2007-09-05 23:45 ` furue
2007-09-06 16:13 ` Edward O'Connor
` (3 more replies)
0 siblings, 4 replies; 10+ messages in thread
From: furue @ 2007-09-05 23:45 UTC (permalink / raw)
To: help-gnu-emacs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="us-ascii", Size: 884 bytes --]
On Sep 5, 9:46 am, Stefan Reichör <ste...@xsteve.at> wrote:
> David Hansen <david.han...@gmx.net> writes:
> > On Tue, 04 Sep 2007 12:18:52 -0700 fu...@hawaii.edu wrote:
[ . . . ]
> I tried the following:
> alias tcp 'cp -i $*'
>
> But this didn't work. That is probably an emacs bug.
Thank you, David and Stefan, for the responses.
I thought I posted a replay yesterday, but it doesn't appear
here. (Probably I hit the "Discard" button instead of the "Send".)
Anyway, my experience is the same. Alias to 'cp -i $*' doesn't
work for me, either. My tentative solution is
alias cp /bin/cp -i $*
which works. This is asthetically incorrect because it doesn't
use eshell's builtin cp.
I'm also wondering where I can find documentations of eshell.
I want/need to learn more, such as "for" loop and "if" constructs
and function definition.
Cheers,
Ryo
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: eshell: how to alias cp 'cp -i' ?
2007-09-05 23:45 ` furue
@ 2007-09-06 16:13 ` Edward O'Connor
[not found] ` <mailman.424.1189095248.18990.help-gnu-emacs@gnu.org>
` (2 subsequent siblings)
3 siblings, 0 replies; 10+ messages in thread
From: Edward O'Connor @ 2007-09-06 16:13 UTC (permalink / raw)
To: help-gnu-emacs
> I'm also wondering where I can find documentations of eshell. I
> want/need to learn more, such as "for" loop and "if" constructs and
> function definition.
There's lots of great material on Eshell on the EmacsWiki:
http://www.emacswiki.org/cgi-bin/wiki/CategoryEshell
Your questions about for loops and functions might be answered on these
pages:
http://www.emacswiki.org/cgi-bin/wiki/EshellForLoop
http://www.emacswiki.org/cgi-bin/wiki/EshellFunctions
While your aliasing problem might be covered here:
http://www.emacswiki.org/cgi-bin/wiki/EshellAlias
--
Edward O'Connor
hober0@gmail.com
Ense petit placidam sub libertate quietem.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: eshell: how to alias cp 'cp -i' ?
[not found] ` <mailman.424.1189095248.18990.help-gnu-emacs@gnu.org>
@ 2007-09-07 7:05 ` furue
2007-09-07 7:24 ` furue
1 sibling, 0 replies; 10+ messages in thread
From: furue @ 2007-09-07 7:05 UTC (permalink / raw)
To: help-gnu-emacs
Edward O'Connor wrote:
> > I'm also wondering where I can find documentations of eshell. I
> > want/need to learn more, such as "for" loop and "if" constructs and
> > function definition.
>
> There's lots of great material on Eshell on the EmacsWiki:
>
> http://www.emacswiki.org/cgi-bin/wiki/CategoryEshell
>
> Your questions about for loops and functions might be answered on these
> pages:
>
> http://www.emacswiki.org/cgi-bin/wiki/EshellForLoop
> http://www.emacswiki.org/cgi-bin/wiki/EshellFunctions
>
> While your aliasing problem might be covered here:
>
> http://www.emacswiki.org/cgi-bin/wiki/EshellAlias
>
>
>
> --
> Edward O'Connor
> hober0@gmail.com
>
> Ense petit placidam sub libertate quietem.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: eshell: how to alias cp 'cp -i' ?
[not found] ` <mailman.424.1189095248.18990.help-gnu-emacs@gnu.org>
2007-09-07 7:05 ` furue
@ 2007-09-07 7:24 ` furue
1 sibling, 0 replies; 10+ messages in thread
From: furue @ 2007-09-07 7:24 UTC (permalink / raw)
To: help-gnu-emacs
Oh no, I sent out a reply without my comments added.
That was my first attempt post from this queer browser
(w3m) and didn't know how to edit the text box. Sorry.
Edward O'Connor wrote:
> > I'm also wondering where I can find documentations of eshell. I
> > want/need to learn more, such as "for" loop and "if" constructs and
> > function definition.
>
> There's lots of great material on Eshell on the EmacsWiki:
Wow, that's a good source of information. Thank you!
Unfortunately the problem of aliasing "cp -i" isn't mentioned
in the EshellAlias section. There was a page unrelated
to alias that talks about Lisp variables which make cp, mv, etc.
ask before overwriting. This is one solution as long as
concerning those commands.
Regards,
Ryo
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: eshell: how to alias cp 'cp -i' ?
2007-09-05 23:45 ` furue
2007-09-06 16:13 ` Edward O'Connor
[not found] ` <mailman.424.1189095248.18990.help-gnu-emacs@gnu.org>
@ 2007-09-07 21:44 ` Peter Dyballa
[not found] ` <mailman.479.1189201469.18990.help-gnu-emacs@gnu.org>
3 siblings, 0 replies; 10+ messages in thread
From: Peter Dyballa @ 2007-09-07 21:44 UTC (permalink / raw)
To: furue; +Cc: help-gnu-emacs
Am 06.09.2007 um 01:45 schrieb furue@hawaii.edu:
> My tentative solution is
>
> alias cp /bin/cp -i $*
>
> which works. This is asthetically incorrect because it doesn't
> use eshell's builtin cp.
Have you read about the variable eshell-cp-interactive-query?
--
Greetings
Pete
"America believes in education: the average professor earns more money
in a year than a professional athlete earns in a whole week." – Evan
Esar
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: eshell: how to alias cp 'cp -i' ?
[not found] ` <mailman.479.1189201469.18990.help-gnu-emacs@gnu.org>
@ 2007-09-07 22:08 ` furue
2007-09-07 23:08 ` Peter Dyballa
0 siblings, 1 reply; 10+ messages in thread
From: furue @ 2007-09-07 22:08 UTC (permalink / raw)
To: help-gnu-emacs
Peter Dyballa wrote:
> Am 06.09.2007 um 01:45 schrieb furue@hawaii.edu:
>
> > My tentative solution is
> >
> > alias cp /bin/cp -i $*
> >
> > which works. This is asthetically incorrect because it doesn't
> > use eshell's builtin cp.
>
> Have you read about the variable eshell-cp-interactive-query?
Thanks. Yes, I read it. That was what I meant in my last posting
by the Lisp variable that changes the behavior of cp. According
to the Emacs Wiki, the following setting
(setq eshell-cp-interactive-query t)
should work. (I haven't tested it.) Probably I'll switch to
this solution soon, but I'm now looking for the ways to store
this kind of Lisp expressions. I can write them in ~/.emacs ,
but I don't want to clutter it too much. I imagine that
~/.eshell/startup.el, ~/.emacs-eshell.el, or some such file
is read when eshell starts up. I'm reading the Wiki and other
documentations, trying to find it.
Regards,
Ryo
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: eshell: how to alias cp 'cp -i' ?
2007-09-07 22:08 ` furue
@ 2007-09-07 23:08 ` Peter Dyballa
0 siblings, 0 replies; 10+ messages in thread
From: Peter Dyballa @ 2007-09-07 23:08 UTC (permalink / raw)
To: furue; +Cc: help-gnu-emacs
Am 08.09.2007 um 00:08 schrieb furue@hawaii.edu:
> I imagine that ~/.eshell/startup.el, ~/.emacs-eshell.el, or some
> such file is read when eshell starts up.
~/.eshell/login AFAIK. I never used this feature ... (I still prefer
the *shell* buffer)
Besides there are hundreds of eshell-what-so-ever variables. There
surely is one that determines the login file.
--
Greetings
Pete
Got Mole problems?
Call Avogadro 6.02 x 10^23
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2007-09-07 23:08 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-04 19:18 eshell: how to alias cp 'cp -i' ? furue
2007-09-05 0:36 ` David Hansen
[not found] ` <mailman.329.1188952757.18990.help-gnu-emacs@gnu.org>
2007-09-05 19:46 ` Stefan Reichör
2007-09-05 23:45 ` furue
2007-09-06 16:13 ` Edward O'Connor
[not found] ` <mailman.424.1189095248.18990.help-gnu-emacs@gnu.org>
2007-09-07 7:05 ` furue
2007-09-07 7:24 ` furue
2007-09-07 21:44 ` Peter Dyballa
[not found] ` <mailman.479.1189201469.18990.help-gnu-emacs@gnu.org>
2007-09-07 22:08 ` furue
2007-09-07 23:08 ` Peter Dyballa
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).