exec

(Tcl/Expect) clear screen after exit

I want to clear the screen (on the local machine) after exiting from my (semi) interactive expect script. Can I do that from within the script? Here's what I tried, that failed. #!/usr/bin/expect -f set env(TERM) vt100 spawn ssh -Y username@domain set user username set pass password #login sequence expect "password: " send "${pass}\r"...

PHP exec command

Hello guys! I am working on a project where I have to defend the website against code injection. Is there a list with all shell commands which doesn't need the php exec function? So a list with shell commands that can be performed from php without the exec command? ...

exec() or system() on doxygen command returns me "Exiting"

Itry to run this script public function execDoxygen($doxyFile) { $command = "doxygen $doxyFile"; exec($command, $output); return $output; } and the outputs is "Exiting..." if I run it separetely in a terminal with the same file it works well. If I run exec("doxygen --help") it works correctly. Why does it ...

GPG key import through PHP not working (works in shell)

Hello, I have to import a GPG key in a PHP script, it works using the commande line gpg --import "/home/me/pubkey.txt" but does not work using the PHP gpg class with the import method even with the gnupg_import function. My configuration is : RedHat Enterprise Linux 5 PHP 5.1.6 GnuPG 1.4.5 GPGme 1.1.8 GPG extension 1.3.1 I also...

exec function in PHP and passthru?

Hello I have a couple questions about PHP exec() and passthru(). 1) I never used exec() in PHP but I have seen it is sometimes used with imagemagick. I am now curious, what is some other common uses where exec is good in a web application? 2) About 6 years ago when I first started playing around with PHP I did not really know anythi...

how to zip by exec command line through php

Hello, I have a ubuntu server. How can I zip files through executing a command line to zip from my php script I want to zip the file because the file sizes are too big and zipping it through php will cause more load on server. Thank You. ...

CodeIgniter + nfsn_exec() replacement to exec() at nearlyfreespeech.net = fail :(

Hi I use NearlyFreeSpeech.Net as my host, and my php app (coded in CodeIgniter) needs to make exec() calls. As this is not allowed under safe-mode, we are given a "special" was of executing things via a perl script. See details here: https://members.nearlyfreespeech.net/wiki/HowTo/PHPExec However, following those instructions causes th...

Cannot change global variables in a function through an exec() statement?

Why can I not change global variables from inside a function, using exec()? It works fine when the assignment statement is outside of exec(). Here is an example of my problem: >>> myvar = 'test' >>> def myfunc(): ... global myvar ... exec('myvar = "changed!"') ... print(myvar) ... >>> myfunc() test >>> print(myvar) test ...

Java Shell wildcard tokenizer

My Java is extremely rusty and I'm stuck trying to make a user interface that simplifies the execution of shell scripts or batch files depending on whether it's Linus or Win32 respectively. The files have the following naming convention. module-verb-object-etc [args-list] mysql-connect-grid mysql-connect-rds mysql-dump-grid m...

PHP exec() call never runs

I believe this is a permissions issue, but not sure how to fix it. I have a php script -- mainscript.php -- that calls: $scriptCall = "/usr/bin/php wrap_prep.php 2>&1 &"; When running mainscript.php, the wrap_prep.php never executes. However, when I log into my webserver as root and run php wrap_prep.php 2>&1 & it works fine. I ha...

php exec, passthru function work arounds when disabled on the host.

My site is php based and the host disabled exec() and passthru() and system(). I have a script that needs these functions. Is there any work arounds? The commands my script to run is simple mysqldump to backup my database. If there's no work arounds to use those functions. Is there another way to do the backup without the need to use th...

Uploading a file through exec, hanging script

Basically in a nutshell is I am using exec() to run WinSCP, which is causing the script to hold until the file is uploaded. Is there anyway to make it so that the script continues, and the upload runs in the background? Running PHP 5.3.1 on Win7. ...

socket() returns 0 C client / server app

I'm working on an application that contains several server sockets that each run in a unique thread. An external utility (script) is called by one of the threads. This script calls a utility (client) that sends a message to one of the server sockets. Initially, I was using system() to execute this external script, but we couldn't use t...

PHP: exec(svn commit) is not returning any errors nor working..

Currently I'm writing out files with php into a directory, I add that directory (works fine), then when i try and do an svn commit its not working nor returning any kind of error codes. Does anyone have any idea on this? $tmp = exec('cd '.$this->build_locations[$this->type].'; svn commit --username user --password pw; ls', $output); I...

How to untaint execution of system command

I have a script that can be called by untrusted users, we need to make a call along the lines of this made up example: system 'somescript ' + data We need to ensure if data == 'filename; dosomethingelse' then the ; is escaped (or any other special character. The result is the shell command run is actually somescript filename\;\ dosome...

PHP shell tar problem, return code 2

Want to archive a folder using tar from PHP: $result = shell_exec("tar cf $sourceFile $sourceFolder -C $source > /dev/null; echo $?"); var_dump($result); Output: string(2) "2 " the > /dev/null; echo $? thing is for outputing the result code of a script under linux; the -C $source - changes to the right folder before doing anythi...

Unable to use "execve()" successfully....

The aim of the program is to fork a new child process and execute a process which also has command line arguments.. If i enter "/bin/ls --help". I get the error... shadyabhi@shadyabhi-desktop:~/lab/200801076_lab3$ ./a.out Enter the name of the executable(with full path)/bin/ls --help Starting the executable as a new child process... B...

Maximum execution time of 60 seconds exceeded

Hi. Is it possible to set maximum execution time of exec($command) function? Sometimes execution of my $command lasts too long and after 1min it stop execution and i receive this error: Fatal error: Maximum execution time of 60 seconds exceeded in C:\xampp\htdocs\files.php on line 51 how to increase the exec command maximum execution ...

Getting PHP to run a Python script

Hi all, I am trying to run a Python program using PHP. Here's the code $command = '/usr/local/bin/python script.py file'; $temp = exec($command, $output); This works through the command line but not while running it through the browser. I am using Apache so probably it needs the right privileges? I am pretty new to Linux and have no i...

What's the difference between eval, exec, and compile in Python?

I've been looking at dynamic evaluation of Python code, and come across the eval() and compile() functions, and the exec statement. Can someone please explain the difference between eval and exec, and how the different modes of compile() fit in? ...