473,396 Members | 1,914 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

bollhy"system" function output displays twice last line

hello,

i use a small PHP script to grab DNS infos at http://80.247.230.136/bug/php/
(php and txt available)

the trouble is the last line of every output given by "system"
function is always displayed twice, is it really a bug ?

http://80.247.230.136/bug/php/indexe...willemijns.com
Oct 29 '08 #1
4 1909
se******************@gmail.com wrote:
the trouble is the last line of every output given by "system"
function is always displayed twice, is it really a bug ?
No, it's a feature. system() displays (part of) the output of the command
*and* returns the output of the command.

Try "system(foo);" instead of "echo system(foo);". And, as always, RTFM.

Cheers,
--
----------------------------------
Iván Sánchez Ortega -ivan-algarroba-sanchezortega-punto-es-

You will attract cultured and artistic people to your home.

Oct 30 '08 #2
On Oct 29, 5:18*pm, sebastien.willemi...@gmail.com wrote:
hello,

i use a small PHP script to grab DNS infos athttp://80.247.230.136/bug/php/
(php and txt available)

the trouble is the last line of every output given by "system"
function is always displayed twice, is it really a bug ?

http://80.247.230.136/bug/php/indexe...willemijns.com
More like a bug in the system program you're using... Check that
first, and then get back to us.
Oct 30 '08 #3
On Oct 30, 3:10 am, Michael Sherwood <coolha...@gmail.comwrote:
More like a bug in the system program you're using... Check that
first, and then get back to us.
no, kon from #PHP on irc.oftc.net have the workaround... use passthru
and now this script works ;)
thanks to this guy (or girl ? ;)
Oct 30 '08 #4
On Oct 30, 12:03 pm, "sebast...@willemijns.com"
<sebast...@willemijns.comwrote:
On Oct 30, 3:10 am, Michael Sherwood <coolha...@gmail.comwrote:
More like a bug in the system program you're using... Check that
first, and then get back to us.

no, kon from #PHP on irc.oftc.net have the workaround... use passthru
and now this script works ;)
thanks to this guy (or girl ? ;)
pfffffff.... i have quicky tested
passthru works well and Try "system(foo);" instead of "echo
system(foo);" too ;)

in all case, thanks to your answers ;)
Oct 30 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Eric Lavigne | last post by:
Here is a shell command (MS-DOS): debug\curve-fit <input.txt >output.txt And here is a Python script that *should* do the same thing (and almost does): import os inputfilename =...
16
by: DJP | last post by:
Hi, I need to read a file programmatically until end of file. My logic is as follows: while(!feof(Fp)) { fgets(readLine,10000,Fp);
35
by: RyanS09 | last post by:
Hello- I am trying to write a snippet which will open a text file with an integer on each line. I would like to read the last integer in the file. I am currently using: file = fopen("f.txt",...
3
by: seven.reeds | last post by:
Hi, I am running php v 5.0.0 on a redhat box. I have a php script in a file called p_script_1. I have another small script in file p_script_2. p_script_1 calles p_script_2 through a system()...
1
by: Patrick | last post by:
Hi All, Can someone take a look at my script and tell me if I am missing something as to why the last line of data from my input file is being written twice in the echo. I have included a short...
6
by: magix | last post by:
Hi, when I read entries in file i.e text file, how can I determine the first line and the last line ? I know the first line of entry can be filtered using counter, but how about the last line...
12
by: Curten | last post by:
Hi, I'm using ifstream to read data from a txt-file but the last line is always read twice. How Come? The condition for the loop in which the file is read is while(!infile.eof()) so this...
1
by: empaleador | last post by:
Hi I m reading a file that ends with a blank line and when i do the output it repeats the line before the blank 2 times. I am using ifstream infile; infile.open...
3
by: PNY | last post by:
Hi all, I've made a form where it lists records sorted by their associated autonumber ID. The last line of this form displays a blank line with "AutoNumber" shown in its respective cell as if to...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.