Re: problem with "<" in linux



On 9 Jul, 21:05, j...@xxxxxxxxxxx (Jens Thoms Toerring) wrote:
Jens Thoms Toerring <j...@xxxxxxxxxxx> wrote:

That's probably the simplest alternative, but then make it
execv( "/bin/sh", "/bin/sh", "-c", "program", "<", "file1" );

Grrr. Now I also forgot '(char *) NULL' as the last argument.
And, of course, it must be the execl() function, execv() would
require an array of arguments instead of a list of arguments.
So make it

execl( "/bin/sh", "/bin/sh", "-c", "program", "<",
"file1", ( char * ) NULL );

Shouldn't that be:

execl( "/bin/sh", "/bin/sh", "-c", "program < file1", NULL );


.



Relevant Pages

  • Re: problem with "<" in linux
    ... William Pursell writes: ... Grrr. ... And, of course, it must be the execl() function, execv() would ...
    (comp.unix.programmer)
  • Re: problem with "<" in linux
    ... Jens Thoms Toerring wrote: ... Grrr. ... And, of course, it must be the execl() function, execv() would ...
    (comp.unix.programmer)
  • Re: execl() and passing an integer
    ... > I am writing a program that forks to a child and parent. ... > the child's code is run it calls execl(). ... > be passed as arguments but I need to pass an integer (the parent pid). ... > pass that array in the execlcall. ...
    (comp.unix.programmer)
  • Re: execl() and passing an integer
    ... > the child's code is run it calls execl(). ... > be passed as arguments but I need to pass an integer (the parent pid). ... > pass that array in the execlcall. ... and then convert it frorm ASCII: ...
    (comp.unix.programmer)
  • Re: execl() and passing an integer
    ... > I am writing a program that forks to a child and parent. ... > the child's code is run it calls execl(). ... > be passed as arguments but I need to pass an integer (the parent pid). ... > pass that array in the execlcall. ...
    (comp.unix.programmer)