Re: DOS newlines (CR/LF) to Unix format [message #171898 is a reply to message #171894] |
Thu, 20 January 2011 15:45 |
Bjarne Jensen
Messages: 9 Registered: January 2011
Karma:
|
Junior Member |
|
|
On 2011-01-20 14:17, Luuk wrote:
> If you have this PHP-file:
> <?php
> exec('awk --version>awk.txt', $result, $retun_var);
> print_r($result);
> print "Return_var: $return_var<br>";
>
> exec("awk '{ print $1 }' awk.txt", $two, $return_var);
> print_r($two);
> print "Return_var: $return_var<br>";
> ?>
>
>
> The output should be:
> Array ( ) Return_var:
> Array ( [0] => GNU [1] => Copyright [2] => [3] => This [4] => it [5] =>
> the [6] => (at [7] => [8] => This [9] => but [10] => MERCHANTABILITY
> [11] => GNU [12] => [13] => You [14] => along ) Return_var: 0
>
> (at least if your awk-version is "GNU Awk 3.1.6" ;)
>
> If awk cannot be executed, the output will be:
> Array ( ) Return_var:
> Array ( ) Return_var: 2
Array
(
)
Return_var: 0
Array
(
[0] => GNU
[1] => Copyright
[2] =>
[3] => This
[4] => it
[5] => the
[6] => (at
[7] =>
[8] => This
[9] => but
[10] => MERCHANTABILITY
[11] => GNU
[12] =>
[13] => You
[14] => along
)
Return_var: 0
So - it is there but....
|
|
|