title: PHPSeclib additional line breaks using write
body: <p>I'm getting close to the point of simply moving this back to PERL for a specific use case of editing files via SSH.  It seems no matter what I do, additional line breaks are being placed in the file.  Sample variable has the following:</p>
  
  <pre><code>req_extensions = v3_req
  prompt = no
  [req_distinguished_name]
  C = US
  </code></pre>
  
  <p>Using the following command, I get the output below</p>
  
  <pre><code>$ssh-&gt;write("echo '$file' &gt; /directory/test.txt\n");
  </code></pre>
  
  <p>Resulting in:</p>
  
  <pre><code>req_extensions = v3_req
  
  prompt = no
  
  [req_distinguished_name]
  
  C = US
  </code></pre>
  
  <p>Edit adding relevant debug log:</p>
  
  <pre><code>&lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0022, network: 0s)
  00000000  00:00:00:02:00:00:00:01:65                       ........e
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0005, network: 0.0001s)
  00000000  00:00:00:02:00:00:00:01:63                       ........c
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0005, network: 0s)
  00000000  00:00:00:02:00:00:00:01:68                       ........h
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0003, network: 0s)
  00000000  00:00:00:02:00:00:00:01:6f                       ........o
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0005, network: 0.0003s)
  00000000  00:00:00:02:00:00:00:01:20                       ........ 
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0004, network: 0s)
  00000000  00:00:00:02:00:00:00:01:27                       ........'
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0002, network: 0.0001s)
  00000000  00:00:00:02:00:00:00:01:72                       ........r
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0001, network: 0s)
  00000000  00:00:00:02:00:00:00:01:65                       ........e
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0003, network: 0.0002s)
  00000000  00:00:00:02:00:00:00:01:71                       ........q
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0001, network: 0s)
  00000000  00:00:00:02:00:00:00:01:5f                       ........_
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0001, network: 0s)
  00000000  00:00:00:02:00:00:00:01:65                       ........e
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0007, network: 0.0006s)
  00000000  00:00:00:02:00:00:00:01:78                       ........x
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0003, network: 0s)
  00000000  00:00:00:02:00:00:00:01:74                       ........t
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0002, network: 0.0001s)
  00000000  00:00:00:02:00:00:00:01:65                       ........e
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0003, network: 0.0002s)
  00000000  00:00:00:02:00:00:00:01:6e                       ........n
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0002, network: 0s)
  00000000  00:00:00:02:00:00:00:01:73                       ........s
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0001, network: 0s)
  00000000  00:00:00:02:00:00:00:01:69                       ........i
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0005, network: 0.0002s)
  00000000  00:00:00:02:00:00:00:01:6f                       ........o
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0005, network: 0s)
  00000000  00:00:00:02:00:00:00:01:6e                       ........n
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0001, network: 0s)
  00000000  00:00:00:02:00:00:00:01:73                       ........s
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0001, network: 0s)
  00000000  00:00:00:02:00:00:00:01:20                       ........ 
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0004, network: 0s)
  00000000  00:00:00:02:00:00:00:01:3d                       ........=
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0001, network: 0s)
  00000000  00:00:00:02:00:00:00:01:20                       ........ 
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0002, network: 0s)
  00000000  00:00:00:02:00:00:00:01:76                       ........v
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0001, network: 0s)
  00000000  00:00:00:02:00:00:00:01:33                       ........3
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0002, network: 0s)
  00000000  00:00:00:02:00:00:00:01:5f                       ........_
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0002, network: 0s)
  00000000  00:00:00:02:00:00:00:01:72                       ........r
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0001, network: 0s)
  00000000  00:00:00:02:00:00:00:01:65                       ........e
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0002, network: 0.0001s)
  00000000  00:00:00:02:00:00:00:01:71                       ........q
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0001, network: 0s)
  00000000  00:00:00:02:00:00:00:02:0d:0a                    ..........
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0001, network: 0s)
  00000000  00:00:00:02:00:00:00:02:3e:20                    ........&gt; 
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0005, network: 0.0004s)
  00000000  00:00:00:02:00:00:00:02:0d:0a                    ..........
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0001, network: 0s)
  00000000  00:00:00:02:00:00:00:02:3e:20                    ........&gt; 
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0001, network: 0s)
  00000000  00:00:00:02:00:00:00:01:70                       ........p
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0001, network: 0s)
  00000000  00:00:00:02:00:00:00:01:72                       ........r
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0001, network: 0s)
  00000000  00:00:00:02:00:00:00:01:6f                       ........o
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0001, network: 0s)
  00000000  00:00:00:02:00:00:00:01:6d                       ........m
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0002, network: 0.0001s)
  00000000  00:00:00:02:00:00:00:01:70                       ........p
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0002, network: 0s)
  00000000  00:00:00:02:00:00:00:01:74                       ........t
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0001, network: 0s)
  00000000  00:00:00:02:00:00:00:01:20                       ........ 
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0002, network: 0s)
  00000000  00:00:00:02:00:00:00:01:3d                       ........=
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0001, network: 0s)
  00000000  00:00:00:02:00:00:00:01:20                       ........ 
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0002, network: 0.0002s)
  00000000  00:00:00:02:00:00:00:01:6e                       ........n
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0001, network: 0s)
  00000000  00:00:00:02:00:00:00:01:6f                       ........o
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0002, network: 0.0002s)
  00000000  00:00:00:02:00:00:00:02:0d:0a                    ..........
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0001, network: 0s)
  00000000  00:00:00:02:00:00:00:02:3e:20                    ........&gt; 
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0001, network: 0s)
  00000000  00:00:00:02:00:00:00:02:0d:0a                    ..........
  
  &lt;- NET_SSH2_MSG_CHANNEL_DATA (since last: 0.0001, network: 0s)
  00000000  00:00:00:02:00:00:00:02:3e:20                    ........&gt; 
  </code></pre>
  
  <p>TIA</p>