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
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 23:01:28 2024 UTC