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 Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or 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

Add a Patch

Pull Requests

Add a Pull Request

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-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC