This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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

Can't think of a witty .sigline today....

Unsubscribe info:
Problem reports:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]