Menu
  • HOME
  • TAGS

I'm confused how this execvp() is handled in this sample function which uses fork() to clone a process

c++,c,linux,exec,fork

You can have a look at the manpage for execvp, it says: The exec() family of functions replaces the current process image with a new process image. So, what does that mean? It means, if execvp succeeds, your program wont be in memory anymore, thus it wont ever reach the...

What happend with exec in Python3.3? [duplicate]

python,exec

Because exec() is now a function, you can no longer use it to set local names in Python functions. In Python 2, where exec is a statement, the compiler could detect its use and disable the normal local name optimisations in place for functions. Execute your code into a new...

Space character ignored in the linux exec file

linux,shell,exec

Yes, you need to double-quote the argument: source "${DIR}/envconv.sh" ...

what happens when I exec() from a forked child in c

c,exec,fork

"foo calls fork() and now I have two, call them foo_parent and foo_child." Less confusing: you still have the process foo (parent) and now you also have a child process (foo_child). "Is foo overwritten in memory with bar?" When foo_child calls exec(), then its memory space is overwritten with that...

PHP exec() function throws empty array values with apache, but CLI's are fine

php,arrays,exec

The issue is that when you are logged in via the CLI the user which we'll call root. However when you are accessing through your browser, which goes through your webserver, it's logged in with a different user which we'll apache. root has access to the UUID, apache does not....

Call to a member function exec() on a non-object ERROR in PHP [duplicate]

php,mysql,exec

I suspect that $db is either not an object (if it's not actually NULL), or $db doesn't have a function named exec. I recommend you verify that your connection to the database is successful, and verify that $db is the connection object. Verify that exec is a valid function for...

Gatling 2: concurrent request handling

asynchronous,concurrency,resources,exec,gatling

Answer is: b, when all resources have been fetched.

How to put arguments in a function at run time?

c++,linux,runtime,exec,argument-passing

If you are not required to use execlp, execv or execvp are better functions for your requirement. From http://linux.die.net/man/3/execlp The execv(), execvp(), and execvpe() functions provide an array of pointers to null-terminated strings that represent the argument list available to the new program. The first argument, by convention, should point...

tsql - sp_executesql difference

sql-server,tsql,stored-procedures,exec,sp-executesql

Okay, as identified in a comment the issue is the order of parameters. To demonstrate the issue imagine the following simple procedure CREATE PROCEDURE dbo.TestProc @A INT = NULL, @B INT = NULL, @C INT = NULL AS BEGIN SELECT TOP 1 A = @A, B = @B, C =...

Linux: system() from a memory-intensive process without forking

c++,linux,exec,fork,system

If your implementation includes posix_spawn(), this is a more viable alternative. #include <spawn.h> http://fixunix.com/unix/84486-difference-between-spawn-fork.html...

Cannot run program “…/abc.exe”: error=13, Permission denied

java,exec

You need to change permission of xyz.exe chmod u+x /Users/abc/xyz.exe ...

real-time TCL exec output

tcl,try-catch,exec

If you do: exec echo calling a BIG script >@stdout # Everything wrapped around the exec is the same; I omit it for brevity Then the output from the script will be written straight to standard out. However, you lose the ability to read it from your Tcl script. To...

Passing int using char pointer in C

c,exec,ipc

Programs simply do not take integers as arguments, they take strings. Those strings can be decimal representations of integers, but they are still strings. So you are asking how to do something that simply doesn't make any sense. Twenty is an integer. It's the number of things you have if...

What happens to memory passed in arguments to exec*() family of functions?

c++,memory,exec

From the execv man page: The execv(), execvp(), and execvpe() functions provide an array of pointers to null-terminated strings that represent the argument list available to the new program. The first argument, by convention, should point to the filename associated with the file being executed. The array of pointers must...

execl not running programming

c++,c,process,exec

According to the spec, the argument list to execl must be terminated by a NULL pointer (i.e. (char *)0, not ""). Changing the nearby code is just changing what happens to be on the stack when you invoke execl. As written, the program's behavior is undefined. P.S. Always check the...

PHP SSH2 exec “$”

php,ssh,exec

Passing a GET variable to an ssh2_exec() is probably a huge security issue. But disregarding that, single quotes ignore variables - you need double quotes for that. In other words: change this if (!($stream = ssh2_exec($con, 'wall echo $msg'))) { to this if (!($stream = ssh2_exec($con, "wall echo $msg"))) {...

Using exec to relaunch crashing binary

bash,exec

I don't know specifically what you saw, but there are conceivable ways of using exec in a loop to launch and relaunch a process, e.g. while true do ( unset DISPLAY && exec ./myfile ) done The ( .. ) here is an explicit subshell, so there is a fork...

Why are execv*() arguments inconsistent with execl*()?

c,exec,standards,argv

I can't find an authoritative answer, but I suspect the two call signatures differ based on how they are created and how they are used. In the case of execl*(), it's entirely possible your function was passed a const char* which you are passing on. If the signature of execl*()...

how to end redirected execlp in c

c,pipe,exec,posix

I think you want this. move the close up so the read can know that it won't get any more. write(par_pipe[1], "haha\n", 5); close(par_pipe[1]); you seem to missing a dup for stdout in the child segment too,...

Why doesn't execlp allow me to use a pipe?

c,unix,pipe,exec

When you write the following command in a shell ls -l | sort two programs are executed: ls and sort. The pipe character (|) means that the output of the first should be redirected to the standard input of the second. This pipe is interpreted by your shell. It is...

Pass complete code to phantomjs

go,phantomjs,exec

PhantomJS has an interactive version where you can pass code in through stdin, but there is a bug (versions 1.9.x and 2.0.0) because of which no pages can be opened which makes this effectively unusable. There is no way to pass a script into PhantomJS to be interpreted. You need...

run bash script from php exec()

php,linux,bash,exec,iptables

Firstly, you can't sudo it directly like that. So you have to change some configurations in sudoers file. Run sudo visudo in console, add the following line at the end of file nobody ALL = NOPASSWD: /var/www/script P.S.: It's a security risk to use your script like that which would...

Running several 'exec' in a ruby loop

ruby,ffmpeg,exec

exec replaces the current process by running the given command. Example: 2.0.0-p598 :001 > exec 'echo "hello"' hello [email protected]:$ You can see how exec replaces the irb with system echo which then exits automatically. Therefore try using system instead. Here the same example using system: 2.0.0-p598 :003 > system 'echo...

cant execute python script from php

php,python,linux,exec,shell-exec

the reason is because of the php doesnt have the permission to write/read the py script in desktop.. so, just change the directory of the py to the same directory as the php file then eveything runs smoothly..

Tesseract exec not working

php,exec,tesseract

I ended up getting this working by just breaking everything down. file_put_contents("$tmpFile",file_get_contents($img)); $cmd = "/usr/local/bin/tesseract $tmpFile stdout"; exec($cmd, $msg); $arraymsg = $msg; $msg = implode(' ', $msg); echo $msg; ...

Edit a find -exec echo command to include a grep for a string

bash,grep,find,exec

That -exec command isn't safe for strings with spaces. You want something like this instead (assuming finding any of the strings is reason not to add any of the strings). find /directory/ -name "file.php" -type f -exec sh -c "grep -q 'string1|string2|string3' \"\$1\" || echo -e 'string1\nstring2\nstring3\n' >> \"\$1\"" -...

Is it possible to pass the parameter in php execution?

php,exec

I think you will need to do couple of things and check again: Your function params uses is fine but try using the full script path. If still it does not function from with in your php script. You will need to check and see if the apache group:user has...

Extra empty string when parsing string into arguments

c,parsing,exec

The code you present will include an empty string (which is not well characterized as "an empty space") at the end of the argument list if the string pointed to by line ends in whitespace. You can avoid that by first truncating any trailing whitespace (spaces, tabs, and/or newlines), by...

Forked and executed program does not returns to console

c++,console,exec,fork

The first program completed, without waiting for the child process to complete. The shell gave you a prompt, but then the output of the ls -l command started. The shell was still waiting for you when you hit the interrupt; if you'd typed echo Hi, it would have done your...

python forked processes not executing with os.execlp

python,osx,exec,forking

The first argument, after the executable, is arg[0] which is by convention the name of the executable. This is useful, if you have symbolic links, which determine the behavior of the programm. In your case, you name the programm '-n' and the real arguments are only -a and Calculator. So...

Runtime.getRuntime().exec() in loops

java,loops,ffmpeg,runtime,exec

Runtime.exec returns a Process instance, which you can use to monitor the status. Process process = Runtime.getRuntime().exec(command); boolean finished = process.waitFor(3, TimeUnit.SECONDS); That last line can be put into a loop, or just set a reasonable timeout....

execl not capturing all arguments

c,exec

You actually need to specify "/path/to/executable" twice. The first one is the program to execute, and the second one is the argv[0] for the new process.

How to create an anonymous pipe between 2 child processes and know their pids (while not using files/named pipes)?

bash,exec,wait,pid

From the Bash man pages: ! Expands to the process ID of the most recently executed back- ground (asynchronous) command. You are not running a background command, you are running process substitution to read to file descriptor 3. The following works, but I'm not sure if it is what you...

EXEC parameters from a SELECT

sql-server,select,exec

How about this. DECLARE @sql NVARCHAR(max) SELECT @sql = 'EXEC traxs_FileMaint_ProductRecord_Insert ' + '@parameter_1,' + S.product + ',' + S.id FROM tablename S WHERE S.selected = 1 EXEC Sp_executesql @sql Note : There should only one row from select else last row will be considered and if Id is of...

Node JS very long process issue

node.js,process,exec,long-integer

Your question is basically this: You want to execute a system command via node, and capture the standard output. The best way to do that is using the child_process module: var sys = require('sys') var exec = require('child_process').exec; exec('node sample.js -mobile production', function(err, stdout, stderr) { console.log('Process finished executing!'); console.log('err:',...

PHP exec() nohup with redirect

php,exec,stdout,stderr,nohup

Got it working. Python does its own output buffering which kept it from writing to the file. Running it with the -u option disables this. Final code looks like this: exec("nohup python -u main.py -i 1 > /var/scripts/logs/1_out.log 2>&1 </dev/null &"); Thanks....

gdb debugging process after exec call

gdb,exec

Here is the code: That's not the code. That's an un-compilable and meaningless snippet of the code. You also didn't tell what OS you are using, or which GDB commands you used. Here is an example showing how this is supposed to work, on Linux: // echo.c #include <stdio.h>...

Confusion with dup2(), exec() and pipes

c,unix,pipe,exec,dup2

Pipes are primarily designed for one-to-one communication — one writer, one reader. While there is nothing that prevents having as many readers and writers as you want, the behavior often makes this not very usable, especially with multiple readers: Reading from a pipe is a destructive operation: each byte sent...

How to execute a program using c code in linux [closed]

c,linux,exec

You can use the exec functions. int execl(const char *path, const char *arg, ...); For example, execl("/bin/ls","ls","-l",NULL); In the path you can give your executable code to run. If you want to give the argument to your functions you can give that in the double quotes....

Ant exec command argument dealing with multiple files

java,ant,less,exec

You can use foreach which requires ant-contrib <target name="view"> <foreach target="call-less" param="file"> <fileset dir="${src}" includes="**/*.java" /> </foreach> </target> <target name="call-less"> <exec executable="less"> <arg value="${file}" /> </exec> </target> ...

ActiveXObject run does not return (shell)

javascript,shell,exec,activex

You have to include the arguments in the parenthesis: x.Run("%comspec% /K dir", 1, true); Currently your script uses a couple of comma operators. At first it executes the Run method, evaluates 1, and finally breaks to an undefined variable name (True). JS is case-sensitive....

execute buffer content in current shell upon exec ssh

perl,shell,exec,stdin

After a bit of digging i found ssh has has an stdio redirector when used with -n option. http://www.pixelbeat.org/programming/stdio_buffering/ To tell ssh that the remote command doesn't require any input use the -n option...

Running a docker container inside another docker container?

node.js,unix,exec,docker,boot2docker

For example, docker run --rm \ -v /var/run/docker.sock:/run/docker.sock \ -v $(which docker):/bin/docker \ --privileged \ node:0.12 node my_script.js ...

Why does execv exit a function?

c,exec

From the start of the exec man page you linked: Exec overlays the calling process with the named file, then transfers to the beginning of the core image of the file. There can be no return from the file; the calling core image is lost. Just like in today's exec...

Client/server: running “nano editor” command from client

c,client-server,exec,nano

Try this: execlp("nano", "nano", "file.txt", NULL); The nano editor must be in your path, the file.txt must be in the current directory of the running client process, and most importantly, whatever display the editor is going to display on must be accessible, be it the terminal from where the client...

Is a Command injection possible in the arg parameter of execve

c,exec

No they can't inject commands unless there is a vulnerability inside ls. See http://linux.die.net/man/2/execve The argument vector and environment can be accessed by the called program's main function, when it is defined as: int main(int argc, char *argv[], char *envp[]) ...

java run shell commmand with EOF

java,process,exec,eof

Your command is writing to the standard in of your process. You could just write to that process from your Java code instead. Something like, String cmd = "myprog -t"; String arg = "show version"; try { Process p = Runtime.getRuntime().exec(cmd); PrintStream ps = new PrintStream(p.getOutputStream()); ps.println(arg); ps.flush(); final StringBuilder...

Calling Python file from within PHP

php,python,windows,exec

Here is the solution, to create a file there is to put this line : fichier = open("C:/Program Files/EasyPHP-DevServer-14.1VC9/data/localweb/projects/Administration/bonsDeCommandes/No15.txt","w"); w creates a file if it doesn't exist already and write over if it does exist instead of this one : fichier = open(repertoire+"C:/Program Files/EasyPHP-DevServer-14.1VC9/data/localweb/projects/Administration/bonsDeCommandes" + nom_fichier, "No13"); ...

go exec with <(..) argument

go,exec

FUZxxl's answer is simple, but it requires the use of bash. Bash is not really cross platform and as an interpreter is open to code injection. I will first describe a way to replicate this with Go, then describe the answer git uses. The <(echo foo) does two things in...

mysqldump command with java Runtime.getRuntime().exec(command) not generating dump

java,runtime,exec,mysqldump

The metacharacter ">" is implemented by the shell; no shell is involved in running a program with Runtime.exec() so the last two arguments to mysqldump are garbage. Use the array argument form of Runtime.exec(); pass "/bin/sh" as the first argument, "-c" as the second, and your command line as the...

Get fast functor from text of expression in Python (faster than eval)

python,performance,exec,eval,functor

Try using list comprehensions. That way you won't have to load the list.append function into memory and it can boost your script, for not having to do a lot of appends, so check this article for a comparison. The code using list comprehensions can be written this way: def FindOccurences(data,...

Exec after forking a process doesn't return the result before the program finishes

c++,c,pipe,exec,fork

The problem is that you call pipe in the grandparent process. After the grandchild process (ls -a) exits, the parent process (sort -r) blocks indefinitely waiting to read more input from the pipe since some process - the grandparent - holds an open descriptor to the write end of the...

Receiving error code during output redirection using execvp

c,exec,fopen,io-redirection,dup2

You cannot use execvp to parse shell commands. The redirection (>) character is understood by the shell (e.g., bash, sh, ksh) and execvp executes the command you pass it directly. It does not try and interpret the arguments and create file redirections, etc. If you want to do that you...

Exec in Python 2.7.6 [duplicate]

python,exec

You can't use exec in a function that has a subfunction, unless you specify a context. From the docs: If exec is used in a function and the function contains a nested block with free variables, the compiler will raise a SyntaxError unless the exec explicitly specifies the local namespace...

docker exec is missing

exec,docker

Update docker on host. docker exec was introduced on docker 1.3.0...

TCL/Expect - exec - how to execute program with parameters

arguments,tcl,exec,command-line-arguments,expect

The safest way to build a command for exec is to use Tcl's list. For example: % set tcl_version 8.5 % set cmd [list ls -l tmp] ls -l tmp % eval exec $cmd total 32 -rw-r--r-- 1 pynexj staff 1176 Jan 23 23:24 file.txt -rw-r--r-- 1 pynexj staff 1176...

Run exec() in PHP as a different Windows user?

php,windows,cordova,exec

Make the binary available to the system account. That's it.

Bash variable substitution on find's output through exec

bash,find,exec,substitution,built-in

It took me a while to get the question. Basically you are asking if something like: echo "${test.png%.png}" could be used to get the word test. The answer is no. The string manipulation operators starting with ${ are a subset of the parameter substitution operators. They work only on variables,...

Running a shell script from java code [duplicate]

java,exec

Your code is right and I am sure you are not getting exceptions, if you read using proc.getErrorStream() you will not get anything. Commands 100% get executed that way, having said that now thing is that you are echo'ing something and you need to read it back using BufferedReader. Check...

How to send a variable between two C programs

c,pipe,exec,fork,argument-passing

You have serveral ways to transfer data to another program. (pipin', files, and way more. I can edit my answer later and give a more standard guide about sending data between two C programs if it's necessary) Let's look execl() for your case. We have to agree first that the...

Preserving the content in valgrind's log files when using --trace-children and execl()

c,exec,valgrind

Possible solution to your problem could be letting valgrind logging to specified file descriptor and this way you can appended to the log file: valgrind --log-fd=9 9>>test.log ./app

how the exec() function maintain the memory spaces?

c,exec,fork

The memory mappings are replaced when you call any of the exec*() functions. It doesn't matter how much memory the child process uses after fork() as exec*() will cause the existing memory mappings of the process to be destroyed and new memory to be allocated/mapped for the new executable. See...

Cross server EXEC

sql,sql-server,exec,linked-server

Same error I also made. So just execute like this: exec sp_executesql @sql...

difference between docker attach and docker exec

docker,exec

There was a commit PR which added to the doc: Note: This command (attach) is not for running a new process in a container. See: docker exec. The answer to "Docker. How to get bash\ssh inside runned container (run -d)?" illustrates the difference: (docker >= 1.3) If we use docker...

Javascript exec returning null

javascript,regex,google-chrome-extension,null,exec

Please could you try as in the following: for (key in regexes) { var m = regexes[key][0].exec(replies[x].innerHTML); if (m !== null) { theNew = regexes[key][1] + m[1] + regexes[key][2]; } } Please, let me know...

Return value of execl [duplicate]

c,linux,gcc,exec

If exec succeeds it will NEVER return. Succeeding means be able to find and launch the command. If it doesn't succeed it will return -1. What you need is to extract the exit value of the command from the status used in the wait in the parent process. You have...

Using setattr() to convert strings to variables

python,string,variables,exec,setattr

For eqn I suggest using a lambda function: eqn = lambda i: 1 / (i + 5) then index is not needed, because it is just "the variable passed to the function" (does not need a name). Then your function becomes def integrate(fn, start = 0, end = 128000, step...

using the find function and the exec flag

bash,find,exec

The semicolon (quoted or escaped) at the end of line is missing. It should be: find <file name> -type f -exec cat {} \; ...

Can't execute exec command (php / windows / ffmpeg)

php,windows,ffmpeg,exec,command-line-interface

I had ffmpeg after ffmpeg.exe - that's why it didn't work. $cmd = 'C:\\wamp\\www\\ffmpeg\\bin\\ffmpeg.exe -i tmp1.flv -c:a copy -vf drawbox=:x=0:y=0:color=invert:t=2 output2.flv 2>&1'; exec($cmd, $output) ...

Passing an instance of DirectoryIterator to another script via exec() is not working as expected

php,file,iterator,exec

Since you pass $fileinfo in a string to the other script it's no longer an instance of DirectoryIterator, because the magic method __toString() is called, which converts it to the filename itself. So you don't need and can't use isDot() or getFilename(), just make a simple if statement like this:...

Compile program in linux using c code [closed]

c,linux,exec

You can use the exec function for compiling that. execl("/usr/bin/gcc or cc","cc","path name or filename",NULL); Using this one you can compile that program easily. If the file name is given it will taken from the current directory. Or else it will taken from the given path....

php exec inside exec / nested exec

php,apache,permissions,exec

Technically it's possible to have an exec in your exec, but it looks like you're using different configurations. Usually PHP has to different sets (Apache and CLI) of php.ini files (which might be configured to disable the exec function at all. I assume your first exec call is coming from...

Creating non blocking pipes to child that does not block and can be reused

c++,pipe,exec,fork

There are several issues to be considered. First, pipes have a finite maximum length (4096 was common in the distant past); any write to a pipe which has more data in it than that will block, as will any read from an empty pipe. These are fundamental to the way...

Student Shell - cd not working

linux,shell,exec,fork,cd

It's true that you need to avoid forking, but you also need to avoid executing. There is no /bin/cd that programs call to change directories. Instead of executing something, call the chdir system call with your path. If the user types cd /tmp, call chdir("/tmp") The current directory is a...

Exec php tar command to backup website dynamically

php,linux,exec,tar

$oky and $out are local variables. They are not set outside the function. $sdir, $name and $root are not defined within the function. Method 1 - Parameters: function backup($sdir,$name,$root,$salt) { exec("tar -cvf $sdir/$name $root/* --exclude='$sdir/$salt' ", $out, $oky); return array("oky"=>$oky, "out"=>$out); } $result = backup($sdir, $name, $root, $salt); if (!$result["oky"])...

Linux, C using cat with exec(3)

c,linux,exec,system-calls,cat

>> is a shell operator. You have not invoked a shell. You must do so if you want to use shell operators. Give /bin/sh -c a try.

How to use eval inside exec in Python 2

python,exec,eval

Legal syntax would be exec("eval('1+1')") but that is pretty pointless, exec is for statements. In [25]: exec("eval('1+1')") In [26]: exec("print(1+1)") 2 In [27]: exec("a = eval('1+1')") In [28]: a Out[28]: 2 ...

shell script, for loop, does loop wait for execution of the command to iterate

bash,shell,for-loop,exec

Assuming that you haven't background-ed the command, then yes. For example: for i in {1..10}; do cmd; done waits for cmd to complete before continuing the loop, whereas: for i in {1..10}; do cmd &; done doesn't. If you want to run your commands in parallel, I would suggest changing...

close(pipe[1]) after exec

c,pipe,exec

If execl() is successful, nothing after it in the original program runs, since it replaces the contents of the process with the program you ask it to run. You need to close the pipe before execl: close(anotherPipe[0]); dup2(anotherPipe[1], 1); //redirect stdout to pipe close(anotherPipe[1]); execl("/usr/bin/who", "usr/bin/who", (char*)NULL); Also, don't forget...

Storing outputs of PHP scripts running in parallel

php,parallel-processing,output,exec

It seems that usually the best way is storing each output to a separate file, because of possible delays caused by locks on one file. UPDATE is very expensive. I compared times of storing 10000 strings into files and MySQL and the times were 2 vs 20 s.

Running multiple exec commands and waiting to finish before continuing

background,tcl,exec,tk

One way is to modify your tests to create a "finished" file. This file should be created whether the test completes correctly or fails. Modify the startup loop to remove this file before starting the test: catch { file delete $path0/$testvar/finished } Then create a second loop: while { true...

Multiple sequential exec tasks in a single bash script

php,bash,exec,avconv

exec replaces the currently running process with the spawned process. It never returns. You can't exec two things like that. That said you don't need to. Just remove exec from those two lines and it should work fine....

tcl exec to open a program with agruments

command-line,tcl,exec

Similar to this question: exec {*}[auto_execok start] notepad++ F:/Path/test.txt -n10 First, you need to supply each argument of the command as separate values, instead of a single string/list. Next, to mimic the start command, you would need to use {*}[auto_execok start]. I also used forward slashes instead of backslashes, since...

Gradle Exec : Why it is not running in configuration phase?

gradle,exec,mkdir

Please have a look at AbstractExecTask from which Exec inherits. As you can see there are lots of getters and setters. What happens at configuration time is setting the values for that fields only, not running them. All the properties set will be used in only when exec() method annotated...

How to increase quality of image through imagemagick binary convert?

php,image,imagemagick,exec,imagemagick-convert

Think sharpen works like blur and takes an argument of {radius}x{sigma} What version are you using? Maybe look at some of the docs that correspond to it... http://www.imagemagick.org/Usage/blur...

nodejs 'exec' command doesn't execute 'sed' command properly

javascript,node.js,sed,exec

I think you need to escape your \n as \\n. Right now, it's getting parsed as a literal newline in the command, which is messing it up.

Make script in c++ for php

php,c++,exec,exe

What you did should work (as long as you print $row). But that may not be the most efficient as it executes the command and builds an array (so the data is not available until the executable finishes). What would be better is to use popen(). This executes the command...

Safe use exec with php

php,exec,shell-exec

Use escapeshellarg(). It ensures that the value is interpreted as a single, plain shell argument. So it will not get executed even if you pass a command as argument. $arg = $_POST['username'] ." ". $_POST['password']; exec("ejabberdctl register ".escapeshellarg($arg)); ...

php script in wamp giving error “not recognized as an internal or external command”

php,wamp,exec

You cannot run PHP code in that way, PHP exists only on the Server and that is how you flag to the broswer that you want to run a client side language like javascript So you could try <html> <body> <h2>xxxxxx!</h2> <?php $score = array(); exec("D:\Users\Owner\Documents\a2 2>&1 D:\Users\Owner\Documents\212.wav D:\Users\Owner\Documents\StartUp\23sw1.wav", $score);...

PHP's exec() printing output — doesn't seem to follow specs

php,exec

What you experience is the normal unix behaviour: An executed command always has two output pipes: standard out and error out. The documentation states that all output is given back. That does not include stuff written to the error output. That is using a separate pipe py purpose to separate...

Echo exec not working tesseract

php,exec,echo,tesseract

Got it working using the following exec('/usr/local/bin/tesseract /images/hello.png stdout', $msg); print_r($msg); ...

What is wrong with my execvp usage?

c,linux,exec,fgets,execvp

After fgets(buffer, BUFFERSIZE, stdin); the buffer always ends with an '\n' since you end your input with a return. Thus if you just pass ls as a command you program gets ls\n and obviously there's no such command or binary in PATH. To fix this you can simply do the...

Java Invalid escape sequences

java,command,exec,command-window

r.exec("cmd /c D:\Doc and Settings\USER\Bureau\Apps-Two.loc.nal"); // Compiler not able to understand this backslash. you should use "\\" wherever you want to use actual backslash (\) change your folder path like this r.exec("cmd /c D:\\oc and Settings\\USER\\Bureau\\Apps-Two.loc.nal"); See the attached table for your reference ...

nodejs synchonous child process in REST API

angularjs,node.js,express,exec

turns out it's easier than it looks. changing from var c=a=[]; to var c=a={}; solves the problem. wonderful how you can look at it a 100 times and never see it, then the next day it's so obvious ...