execl function with pipe

How can I run the following command using execl ?

 
echo "put <filename>" | sftp -i <private_key> <username>@password


 
execl(...)


Many thanks!

Added: P.S. I was using fork and execl to do this.
Last edited on
Topic archived. No new replies allowed.