Programming :: Difference Between PHP Echo() And Print()?
Dec 1, 2010What's the difference between PHP echo() and PHP print(), especially in the execution time?
View 6 RepliesWhat's the difference between PHP echo() and PHP print(), especially in the execution time?
View 6 RepliesWhat is the difference between
$echo cat
$cat echo
How to print "hello" infinite times without using implicit or explicit loop.
View 1 Replies View RelatedI am trying to echo some value using awk, and for reading the file i am using cat command. If there no space in the file content then the following script result correctly.
console: # cat 1
one;two;three;
four;five;six;
[code]....
In case any space is there in the file 1 then i am facing the problem in the output value
console: # cat 1
o ne;two;three;
four;five;six;
[code]....
I'm confused about what "echo $0" in a shell actually return. Consider these tests:
Code:
[root@e11apvl151 ~]# # Login shell:
[root@e11apvl151 ~]# echo $0
-bash
[root@e11apvl151 ~]# # Starting a new shell
[root@e11apvl151 ~]# bash
[root@e11apvl151 ~]# echo $0
bash
[root@e11apvl151 ~]# screen
[root@e11apvl151 ~]# echo $0
/bin/bash
Depending on wether the shell is a login shell, a regular shell, or a screen utility, I get different results.
I am testing the serial ports on a Single Board Computer(SBC) running Linux kernel 2.6.29. I usually do this by connecting the serial port to another PC serial port, then doing "cat /dev/ttyS0" on PC and "echo hello > /dev/ttyS0" on the SBC. However in the current system, "echo hello > /dev/ttyS0" command does not return at all! Also no characters appear on the destination port. I am running the echo command as root. The system boot messages show that the serial port in indeed /dev/ttyS0.
View 2 Replies View RelatedI have always encountered this problem in ubuntu bash shell scripts that echo command in a function will be treated as a return value when used in a function. e.g.
[code]...
The output would simply be xyz. Hence the echo seems to function as a "return" command when used in a function with a return value.
I try to write script and echo two command at the same line .
echo "A"
echo "B"
How can I pipe above two command at the same line in text file . So, in the output text file , you can see below ? Code: A B not Code: A B
I am working on an epoll version of an echoserver that I am porting from a multithreaded version I wrote.What it should do: The server should get a connection from a client > say x client connected > print x message from said client. What it is doing: The server looks like it is only accepting one connection at a time, and any other clients are queued. When the queue is empty it looks like the program is aborting with a SIGABRT. EDIT:// fixed the program exiting in the close function. Still one client at a time
Code:
#include <assert.h>
#include <errno.h>
#include <fcntl.h>
#include <netinet/in.h>
#include <stdio.h>
#include <stdlib.h>
[Code]...
I am a student taking part in a comptition. We have a set of questions to complete within today. Can anyone please help me out with it. I have a custom written "echo" program in C, running on port number "1220" which echoes back the first 16 characters of whatever is given as the first command line argument. But somehow, my brother had got unauthorized remote root access. The program is given below. How did he do it? Please give the exploit code and explain how it works.
#include
#include
void echo(char* input) {
[code]....
I have a problem to use echo to display the content of a variable.
This is what I do:
Code:
#!/bin/bash
USAGE="Usage: name [OPTIONS] [DIRECTORIES]"
echo $USAGE
When I run this little script I get the following output:
Usage: name [OPTIONS] R
So I think that [DI might be some sort of escape sequence. But I do not know how to unescape it. Does anyone have a hint for me?
I am interested in learning 3D programming. The thing is, I would hate to put too much effort to learn something that doesn't have future and is dying. My favorite language at the time is Java. My goal is professional programming.
So I have several questions:
1. Should I learn JOGL or start learning C++ and do C++ openGL programming?
2. Is there a big difference between JOGL and C++ openGL programming?
3. Is it worth to learn openGL? Does it have a future?
4. Is it a big difference between openGL and directX coding?
5. If choosing Java, then JOGL or LWJGL?
Why and what is the main difference between them?
I am trying to automate yum update of specific package on a remote machine. Essentially, the script executes, does a yum update, if not needed it would return echo result "update successful", if it needs the update and it installs it without error, it will return echo result "update successful", or if it fails the update it would echo "update failed". So far I have this:
[code]...
This is OK, but I NEED it to just return the final echo "Update successful". I can't have all the other lines. How can I do this?
Ubuntu 10.04 lucid. sun-java6-jdk has been dropped from the Multiverse section of the Ubuntu archive. They recommend using openjdk-6 instead. Is there any difference between these 2 packages?
View 3 Replies View RelatedI know it's a very silly question but could someone please explain the difference between "/bin/bash" & "/bin/sh" I was under the impression that both are same but following output on my Ubuntu 8.10 is making me raise my eyebrows.
Quote:
parag@station3:~$ ls -l /bin/bash ; ls -l /bin/sh
-rwxr-xr-x 1 root root 725136 2008-05-13 00:18 /bin/bash
lrwxrwxrwx 1 root root 4 2008-12-03 21:42 /bin/sh -> dash
parag@station3:~$
I would like know know difference in ssh comman in solaris and linux, are they both same?
View 2 Replies View RelatedBut what is the difference between this...
Code:
my_fucnction () {
echo "Hello World"
}
Code:
function my_fucnction {
[Code]...
I am not clear with difference between hexdump and objdump and coredump. I wrote a small program
Code:
main (){
int a=2;
int b=4;
int k=b/a;
int m=9;
[Code].....
Some of the above instructions such as 89 d0 should be present in hexdump. What exactly is the hexdump ,objdump and coredump and what is their importance?
I have been spending time (starting yesterday) reverse-engineering GTK+ to get my programming skills up. I came across a struct in the headers (_GtkArg, which was then typedeffed into GtkArg) that includes a union in it that has pretty much the same properties as a struct. Then, there was a struct inside the union.
I'm confused. Just what is the difference between a union and a struct?
P.S. I am using GTK's native C programming language.
difference between setup_irq and request_irq and if there is a difference is there a way to use request_irq instead of setup_irq in this module?
[URL]
What is the difference between *ptr++ and (*ptr)++. In my opinion the terminology is all over the place so if you could give an example it would be better.
View 8 Replies View RelatedI was going through some exercise given in my school. I have read the C book but I am not able to understand some part. That is static variable. What exactly is a static variable and what does it do? I saw in Linux Kernel Programming external and exported are also some thing. I am not getting the difference between static,EXPORT_SYMBOL,external variable types. If I make a kernel module then how will I make sure that my variable is visible to the kernel. Is this what it is all talking about? I have checked this page [URL].
View 2 Replies View RelatedCode:
find . -name *.txt
Code:
find . -name *.txt
I am starting to learn Linux graphical programming. Most of codes in my hands were written based on xlib, which is a kind of old graphic lib. I see some developers more interested in openGL. Then what's the difference between xlib and openGL? And which one is more popular used in which industry area?
View 2 Replies View Related__init() and module_init() - What's the difference
View 3 Replies View RelatedI want to print NaN value in a file containing of 3600 rows and 7 columns.The illustration of output file which I want to is as follows :
NaN NaN NaN NaN NaN NaN NaN (the first row)
NaN .... NaN
.
.
.
NaN .... NaN (the 3600 rows)
I tried to use below command
awk 'BEGIN {for(i = 1; i <= 3600; i++); printf "%s", "NaN", $1" "$2" "$3" "$4" "$5" "$6" "$7}' > output
Unfortunately, I couldn't get what I want to.
Now, I'm ready to run my program, and my code is based on 32bit version. So I run the program on Ubuntu 9.10 32bit. And I got running time for 48s. But that's a bit slower than I expected; the program has bunch of File I/O processing but the result(48s) just doesn't make sense compared to given initial data set. So I just run the same program and same initial data set on Ubuntu 9.10 64bit ver. Then, bang!! it took 1.4s to finish the job.
Do you have any thoughts what kind of fact might make this significant difference? The differences b/w those two OS are "32 vs 64" and 32bit version has Java SDK, Eclipse, Apache2, Mysql, PHP, CGI, and python. We-server service is running but because I'm not really running web server. Did the result come from these background programs?
-- I tested it on the both OS in the same situation as possible as I can.
(reboot->test)
-- BTW 64bit one doesn't have those programs. I just installed on my external hard drive, so it's literary PURE one. (32bit one also in the same HDD)
-- I run these Ubuntus on VMware
Whats the difference, and when do you use which?
View 2 Replies View RelatedIn our college all the systems (running on windows xp) have TURBO C/C++ installed on them which we use for C programming. I recently installed ubuntu 10.04 on me laptop (DELL Inspiron 14R (N4010) with some modifications) i read somewhere on the internet that Gedit can be used for writing a programme in ubuntu which can be compiled using gcc. Well if i use Gedit rather than Turbo c will i experience any differnce?, i mean is there any problem in doing so?? Or i should prefer running turbo c using DOS BOX?
View 7 Replies View RelatedI searched around but I can't get a good handle on the difference between the following formats in BASH shell.
$VAR
$(VAR)
$((VAR))
$($VAR)
$(($VAR))
Can someone explain it, or point to a clear, concise document explaining it?