![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Oct 2005
Posts: 54
Rep Power: 4
![]() |
the > in UNIX
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' ? |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
|
try cat text.txt | new_text.txt
__________________
#programmingforums relay - http://thegupstudio.com/cgi-bin/pforelay.cgi freelance scripts - http://ryanguthrie.com/index.html |
|
|
|
|
|
#3 |
|
Professional Programmer
|
why don't you use fopen, fread and fwrite to read and write from a file, it's more 'php' that way.
|
|
|
|
|
|
#4 | |
|
Professional Programmer
|
Quote:
|
|
|
|
|
|
|
#5 | |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Quote:
![]()
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
|
#6 | |
|
Hobbyist Programmer
|
Quote:
__________________
#programmingforums relay - http://thegupstudio.com/cgi-bin/pforelay.cgi freelance scripts - http://ryanguthrie.com/index.html |
|
|
|
|
|
|
#7 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Fine for the lounge. It's better not to just toss out misleading and undiluted junk in a technical thread. Pipes and redirection aren't the same thing.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|