[Gambas-user] " ls > /dev/pts/0 " by Exec.....

Tobias Boege taboege at ...626...
Tue Oct 2 16:54:09 CEST 2012


On Tue, 02 Oct 2012, Ru Vuott wrote:
> Hello,
> 
> I'ld like launch this line "ls > /dev/pts/0" by "Exec".
> 
> If I write:
> 
>    Exec ["ls", ">", "/dev/pts/0" ]
> 
> it returns an error. It says I cannot access to > : file or directory not found.
> 
> Idem, if I launch:
> 
>    Exec ["ls", "> /dev/pts/0" ]
> 
> 
> And, if I use:
> 
>    Exec ["ls >", /dev/pts/0" ]
> 
> The error message says: cannot run child process: cannot exec program.
> 
> I just can not figure out how to !
> 
> Regards
> vuott

The redirection via > and friends is a feature of your shell. If you want to
use it you have to employ the SHELL instruction, not EXEC, which uses
execve(3) or some variant directly.

Regards,
Tobi




More information about the User mailing list