FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Re: DOS newlines (CR/LF) to Unix format
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: DOS newlines (CR/LF) to Unix format [message #171898 is a reply to message #171894] Thu, 20 January 2011 15:45 Go to previous messageGo to previous message
Bjarne Jensen is currently offline  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....
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: fatal error: cannot redeclare
Next Topic: getting file from <option>
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 23:26:43 GMT 2024

Total time taken to generate the page: 0.03897 seconds