copy: command no found -- why?

  • Follow


Ran 'copy' command as below within an eshell inside NTEmacs 21.3, but
get the
above error. But why?


c:/devkits/cygwin/home/xxx/elisp $ copy setnu.elc setnu.edd
copy: command not found
c:/devkits/cygwin/home/xxx/elisp $ which cp
eshell/cp is a compiled Lisp function in `em-unix'
c:/devkits/cygwin/home/xxxp/elisp $ which ls
eshell/ls is a compiled Lisp function in `em-ls'
c:/devkits/cygwin/home/xxx/elisp $ which copy
which: no copy in
(C:\WINNT\system32;C:\WINNT;C:\WINNT\system32\WBEM;c:\devkits\emacs-20.7\bin;c:\devkits\cscope\bin;c:\devkits\cygwin\usr\local\bin;c:\devkits\cygwin\bin)
c:/devkits/cygwin/home/xxxx/elisp $ 

Any ideas?

0
Reply podi.kuruppu (12) 3/19/2005 2:48:33 AM

Hi slguy,


"slguy" writes:
> Ran 'copy' command as below within an eshell inside NTEmacs 21.3,
> but get the above error. But why?

What makes you expect such a command?

If you are thinking about the COPY command that you can use in
CMD.EXE/COMMAND.COM, that is an *internal* command of those shells,
just like DIR and some others.  So it's not on the path, eshell can't
find it and won't know about it.

I don't know eshell, but if you really need this, you can probably
make some kind of alias that maps "copy" to "CMD.EXE /C COPY".


benny
0
Reply Benjamin 3/19/2005 3:24:53 PM


Actually, I *would* expect it to work because this is NT Emacs so any
and all native Windows commands should naturally be available from
within emacs, if not within
eshell. It is just that eshell appears to be better than a DOS shell
and I was hoping
to migrate my work over to an eshell environment.

I just found that it works fine from within a shell started with 'M-x
shell' command, so I'm sure I'm missing something here.

0
Reply slguy 3/19/2005 5:33:39 PM

slguy wrote:
> Actually, I *would* expect it to work because this is NT Emacs so any
> and all native Windows commands should naturally be available from
> within emacs, if not within
> eshell. It is just that eshell appears to be better than a DOS shell
> and I was hoping
> to migrate my work over to an eshell environment.
> 
> I just found that it works fine from within a shell started with 'M-x
> shell' command, so I'm sure I'm missing something here.

Nope, Windows just doesn't work that way.

Eshell tries to be as close to a Unix Bash shell as possible.  That 
means that all non-built in commands are expected to be programs that 
can be executed.  COPY is not a program (there is no COPY.EXE in 
Windows), so Eshell can't find it.

Eshell implements many of the most commonly used Unix programs (ls, cp, 
mv) in Lisp as built ins.  For copying a file you can use cp like this:

usage: cp [OPTION]... SOURCE DEST
   or:  cp [OPTION]... SOURCE... DIRECTORY

   -- MJF
0
Reply M 3/19/2005 7:45:29 PM

M Jared Finder <jared@hpalace.com> writes:

> Eshell implements many of the most commonly used Unix programs (ls,
> cp, mv) in Lisp as built ins.  For copying a file you can use cp like
> this:
> 
> usage: cp [OPTION]... SOURCE DEST
>    or:  cp [OPTION]... SOURCE... DIRECTORY

Sure, but the  'copy' command is really buried  inside a huge Makefile
we use (and share)) to build software and I'm not at liberty to change
it because others will not compile code necessarily within NTEmacs.

But, I do note your point.
0
Reply Podibanda 3/19/2005 8:09:52 PM

Podibanda Kuruppu wrote:
> M Jared Finder <jared@hpalace.com> writes:
> 
>>Eshell implements many of the most commonly used Unix programs (ls,
>>cp, mv) in Lisp as built ins.  For copying a file you can use cp like
>>this:
>>
>>usage: cp [OPTION]... SOURCE DEST
>>   or:  cp [OPTION]... SOURCE... DIRECTORY
> 
> 
> Sure, but the  'copy' command is really buried  inside a huge Makefile
> we use (and share)) to build software and I'm not at liberty to change
> it because others will not compile code necessarily within NTEmacs.
> 
> But, I do note your point.

Well, there's two solutions I can think of off hand to get around that.

1. As long as copy takes the same parameters in the same order as cp, 
just alias copy to cp in Eshell:  alias copy='cp'
2. Write your own COPY.EXE, using CMD.EXE to execute it.  This should be 
easy to write in C using GetCommandLine() and system().

   -- MJF
0
Reply M 3/19/2005 10:22:35 PM

5 Replies
356 Views

(page loaded in 0.072 seconds)

Similiar Articles:













7/25/2012 2:10:12 AM


Reply: