0 votes
by i.egoshin@yandex.ru (120 points)
Hello. Show code examples using the words >Shell, ShellCmd, sh, shEx. I have tested the following code:

: MYDIR$ Z" dir > с:\test.txt" ;

MYDIR$ >Shell

There is no text file with the results of the command execution on the disk.

1 Answer

0 votes
by Gerald Wodni (1k points)

I can only test it under Linux at the moment, but your code should work:

: MYDIR$ z" ls -l /proc > /tmp/test.txt" ;  ok
MYDIR$ >shell  ok
cr z" cat /tmp/test.txt | tail -n 3" >shell
-r--------  1 root             root                           0 Nov 10 12:19 vmallocinfo
-r--r--r--  1 root             root                           0 Nov 10 12:19 vmstat
-r--r--r--  1 root             root                           0 Nov 10 12:19 zoneinfo

Can you try writing the file to another directory? Maybe you don't have permission to write directly on C:

by i.egoshin@yandex.ru (120 points)
Thanks!


: MYDIR$ Z" dir > d:\test.txt" ;

MYDIR$ >Shell

There is no text file.


Using ShellCmd

: MYDIR$ C" dir > D:\test.txt" ;  ok
MYDIR$ COUNT ShellCmd  ok

There is no text file.
by i.egoshin@yandex.ru (120 points)
I'll try to write a different path to the file.
...