This is the mail archive of the
cygwin
mailing list for the Cygwin project.
RE: g77, Windows XP Professional, CALL System(Command, Status)
- From: "Dave Korn" <dk at artimi dot com>
- To: <cygwin at cygwin dot com>
- Date: Fri, 19 Mar 2004 15:34:28 -0000
- Subject: RE: g77, Windows XP Professional, CALL System(Command, Status)
> -----Original Message-----
> From: cygwin-owner On Behalf Of Lars Steinke
> Sent: 19 March 2004 15:19
> if I use:
>
> call system('cls')
>
> I get the following (new) message:
>
> cls: not found
>
> If I write the cls-command manually in the Win-XP-shell, it works.
> If my program tries to invoke the cls command in the
> Win-XP-shell it does not work?
That's presumably because cls is a builtin command to the XP shell, rather
than a separate executable; presumably the system command is trying and
failing to execute a program called "cls.exe". Instead, try passing cls to
the shell like this:
> call system('cmd.exe /c cls')
You'll probably also need to do the same for other commands such as 'cd'
or 'dir' if you ever want to use them in system calls.
BTW, I see you're using cygwin. That trick is also very useful in bash
shell: I have things like
alias cls='cmd /c cls'
alias start='cmd /c start '
in my .bashrc
cheers,
DaveK
--
Can't think of a witty .sigline today....
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/