Why sudo cat gives a Permission denied but sudo vim works fine? [duplicate]

As @geekosaur explained, the shell does the redirection before running the command. When you type this: sudo foo >/some/file Your current shell process makes a copy of itself that first tries to open /some/file for writing, then if that succeeds it makes that file descriptor its standard output, and only if that succeeds does it … Read more

Why can’t I specify an environment variable and echo it in the same command line?

What you see is the expected behaviour. The trouble is that the parent shell evaluates $SOMEVAR on the command line before it invokes the command with the modified environment. You need to get the evaluation of $SOMEVAR deferred until after the environment is set. Your immediate options include: SOMEVAR=BBB eval echo zzz ‘$SOMEVAR’ zzz. SOMEVAR=BBB … Read more

How to use shell commands in Makefile

With: FILES = $(shell ls) indented underneath all like that, it’s a build command. So this expands $(shell ls), then tries to run the command FILES …. If FILES is supposed to be a make variable, these variables need to be assigned outside the recipe portion, e.g.: FILES = $(shell ls) all: echo $(FILES) Of … Read more

Reference: Comparing PHP’s print and echo

Why two constructs? The truth about print and echo is that while they appear to users as two distinct constructs, they are both really shades of echo if you get down to basics, i.e. look at the internal source code. That source code involves the parser as well as opcode handlers. Consider a simple action … Read more

How are echo and print different in PHP? [duplicate]

From: http://web.archive.org/web/20090221144611/http://faqts.com/knowledge_base/view.phtml/aid/1/fid/40 Speed. There is a difference between the two, but speed-wise it should be irrelevant which one you use. echo is marginally faster since it doesn’t set a return value if you really want to get down to the nitty gritty. Expression. print() behaves like a function in that you can do: $ret = … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)