1 Replies - 1610 Views - Last Post: 02 November 2005 - 03:09 PM Rate Topic: -----

#1 ktsirig  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 94
  • Joined: 14-September 05

the > in UNIX

Posted 02 November 2005 - 12:22 PM

Hi all!
I am confused as to how an old-good UNIX command, like

cat text.txt > new_tex.txt

can be used in PHP.
I tried
system (" cat text.txt > new_text.txt");

but it didn't work, the file new_text.txt was left blank.
Am I doing something wrong with the > ???
Must I use something else instead of 'system' ?
Is This A Good Question/Topic? 0
  • +

Replies To: the > in UNIX

#2 theRemix  Icon User is offline

  • D.I.C Regular

Reputation: 15
  • View blog
  • Posts: 440
  • Joined: 19-October 05

Re: the > in UNIX

Posted 02 November 2005 - 03:09 PM

try this, it might work.
<?php 
echo '<pre>';
$last_line = system('cat text.txt > new_tex.txt', $retval)

echo '
</pre>
<hr />Last line of the output: ' . $last_line . '
<hr />Return value: ' . $retval;

?>



hth
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1