execute

execve() failing to launch program in C

ぃ、小莉子 提交于 2021-02-19 06:16:08
问题 I am trying to spawn a new process using execve() from unistd.h on Linux. I have tried passing it the following parameters execve("/bin/ls", "/bin/ls", NULL); but get no result. I do not get an error either, the program just exits. Is there a reason why this is happening? I have tried launching it as root and regular user. The reason I need to use execve() is because I am trying to get it to work in an assembly call like so program: db "/bin/ls",0 mov eax, 0xb mov ebx, program mov ecx,

execve() failing to launch program in C

余生颓废 提交于 2021-02-19 06:15:40
问题 I am trying to spawn a new process using execve() from unistd.h on Linux. I have tried passing it the following parameters execve("/bin/ls", "/bin/ls", NULL); but get no result. I do not get an error either, the program just exits. Is there a reason why this is happening? I have tried launching it as root and regular user. The reason I need to use execve() is because I am trying to get it to work in an assembly call like so program: db "/bin/ls",0 mov eax, 0xb mov ebx, program mov ecx,

Run a script on a computer from php

人走茶凉 提交于 2021-02-10 06:38:47
问题 I'm unsuccessfully trying to execute a shell command from php. The goal is to switch on/off my music player of my computer/server via internet (with my phone for example). Here is what I would be able to do : I have a very simple file "play.sh" : Code: xdotool key XF86AudioPlay; echo "switched"; if I run it ./play.sh, that works (music player switches on/off) then I have an other very simple php file "play.php" : Code: <?php echo shell_exec("./play.sh"); ?> These two files are in the main

pyodbc execute variable becomes @P1

≯℡__Kan透↙ 提交于 2021-02-07 20:43:04
问题 Hi I'm doing something like: # pyodbc extension cursor.execute("select a from tbl where b=? and c=?", x, y) -- some values in the query in provided by variables. But sometimes the variable is interpreted as @P1 in the query. For example: import pyodbc ch = pyodbc.connect('DRIVER={SQL Server};SERVER=xxxx;DATABASE=xxx;Trusted_Connection=True') cur = ch.cursor() x = 123 cur.execute(''' CREATE TABLE table_? ( id int IDENTITY(1,1) PRIMARY KEY, obj varchar(max) NOT NULL ) ''', x).commit() This

pyodbc execute variable becomes @P1

痴心易碎 提交于 2021-02-07 20:41:39
问题 Hi I'm doing something like: # pyodbc extension cursor.execute("select a from tbl where b=? and c=?", x, y) -- some values in the query in provided by variables. But sometimes the variable is interpreted as @P1 in the query. For example: import pyodbc ch = pyodbc.connect('DRIVER={SQL Server};SERVER=xxxx;DATABASE=xxx;Trusted_Connection=True') cur = ch.cursor() x = 123 cur.execute(''' CREATE TABLE table_? ( id int IDENTITY(1,1) PRIMARY KEY, obj varchar(max) NOT NULL ) ''', x).commit() This

Running multiple C programs from a C program under Linux

懵懂的女人 提交于 2021-02-07 19:22:09
问题 I'm trying to learn a bit or 2 about process communication under Linux, so I wrote 2 simple C programs that communicate with each other. However, it's a bit annoying to have to run them manually every single time, so I'd like to know is there a way to make a program that will run them both, something like this: ./runner program1 program2 I'm using latest Ubuntu and Bash shell. 回答1: run.sh script #!/bin/sh ./program1 & ./program2 & run command: $sh run.sh 回答2: This line will do (in Bash):

How to use at command to set python script execute at specified time

和自甴很熟 提交于 2021-02-04 19:55:33
问题 When I try to use cron to execute my python script in a future time, I found there is a command at, AFAIK, the cron is for periodically execute, but what my scenario is only execute for once in specified time. and my question is how to add python script to at command, also it there some python package for control the at command My dev os is ubuntu 10.04 lucid,and my product server is ubuntu-server 10.04 lucid version. in fact, I want through python script add python script tasks to at command

How to use at command to set python script execute at specified time

倾然丶 夕夏残阳落幕 提交于 2021-02-04 19:55:06
问题 When I try to use cron to execute my python script in a future time, I found there is a command at, AFAIK, the cron is for periodically execute, but what my scenario is only execute for once in specified time. and my question is how to add python script to at command, also it there some python package for control the at command My dev os is ubuntu 10.04 lucid,and my product server is ubuntu-server 10.04 lucid version. in fact, I want through python script add python script tasks to at command

executing as3 code from a string

江枫思渺然 提交于 2021-01-29 02:55:42
问题 I'm working on a simple text rpg and I'm storing all of my data objects out as xml files but I need to be able to run some simple statements for many things. I have done some googling I havent come up with much. What I'm trying to do is take simple statements like: playerhp += 15; or if(playerisvampire == 1) {blah blah;} and embed them inside of the xml structure so that an item or conversation line can contain the checks and executable code leaving the rpg class as more of an interpreter and

executing as3 code from a string

别来无恙 提交于 2021-01-29 02:43:37
问题 I'm working on a simple text rpg and I'm storing all of my data objects out as xml files but I need to be able to run some simple statements for many things. I have done some googling I havent come up with much. What I'm trying to do is take simple statements like: playerhp += 15; or if(playerisvampire == 1) {blah blah;} and embed them inside of the xml structure so that an item or conversation line can contain the checks and executable code leaving the rpg class as more of an interpreter and