php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10301 How can I execute an unix command?
Submitted: 2001-04-12 09:51 UTC Modified: 2001-04-12 10:02 UTC
From: mafra at lcmi dot ufsc dot br Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: Earlier? Upgrade first! OS: linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: mafra at lcmi dot ufsc dot br
New email:
PHP Version: OS:

 

 [2001-04-12 09:51 UTC] mafra at lcmi dot ufsc dot br
For example : 'tail -n 10 test.txt > test2.txt'
I tryed use the exec() function, but without success.

thanks

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-04-12 10:02 UTC] hholzgra@php.net
system(), exec(), the backtick operator `...`
and popen() should all do the job

when dealing with shell functions like output
redirection you should use system() as it
will first start a shell to run the command in

AND YOU SHOULD DEFINETLY CLICK THE DO'S AND DON'TS
LINK ON TOP OF THE ERROR SUBMISSION FORM NEXT TIME

THIS IS NOT A SUPPORT FORUM! ASK THE php-general
MAILING LIST IF YOU HAVE QUESTIONS LIKE THIS!
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed May 07 19:01:32 2025 UTC