title: How wrap a command that is interactive
body: <p>I am building an ftp wrapper that does some stuff before I spawn, I could easily do it in a shell script but wondering how I could do it in go </p>
  
  <p>While exec.Command works for simple commands.</p>
  
  <pre><code>out, err := exec.Command("ls").Output() // Works
  </code></pre>
  
  <p>How do I wrap commands that are interactive e.g., ftp</p>
  
  <pre><code>out, err := exec.Command("ftp").Output()
  </code></pre>
  
  <p>It just exits. How do I deal with stdin ?</p>
  
  <p>e.g., bash equivalent :</p>
  
  <pre><code>&gt; ./t.sh 
  Welcome to myftp 
  
  ftp&gt; open blahblah.com
  
  &gt; cat t.sh 
  #!/bin/bash
  echo "Welcome to myftp "
  #extra commands such as auth/authoriz.. etc.,
  shift
  echo "$@"
  ftp
  </code></pre>
  
  <p>c++ equivalent :</p>
  
  <pre><code>int main() {
      system("ftp");
      return 0;
  }
  </code></pre>