Software :: Execute A Command In The C Program?
Jan 21, 2011I am trying to execute a limux command in c program using system system call, but the dont want it to dump the output or error logs on the terminal.
View 2 RepliesI am trying to execute a limux command in c program using system system call, but the dont want it to dump the output or error logs on the terminal.
View 2 RepliesCommand to compile n execute a Fortran program on a Linux machine
View 6 Replies View RelatedI'm trying to setup a webcam surveillance system. Zoneminder didn't work for me regardless of how I tried configuring it, so I gave up and have now settled on a more primitive solution. I've currently got 6 cams and looping streamer (webcam screen grabber) I can grab a picture from each camera with about a 1 second interval. The previous picture is overwritten and using javascript to reload the image continuously in a browser I get the desired "movie" effect I'm after. The problem however is that as soon as I start using streamer on more than two cameras at once I run into this little snag:
Quote:
libv4l2: error turning on stream: No space left on device
ioctl: VIDIOC_STREAMON(int=1): No space left on device
I've been searching around and it seems I need to increase my shared memory. I've done that (tried many different values and "solutions") but the problem remains the same.
My setup is as follows.
1.php (refreshes updated grab from camera 1 every second in the browser)
2.php (refreshes updated grab from camera 2 every second in the browser)
3.php (refreshes updated grab from camera 3 every second in the browser)
etc
etc.
Is it possible to use something like php exec to execute the command that starts 'streamer' that grabs the image from the specific webcam (/dev/video1 for 1.php and so forth) when 1.php is opened in the browser. Is this even possible, or am I just dreaming?
Is there a way to execute some command and then after the command completes utomatically reboot the system and then after the system reboots execute another command ? For example look at the sequence shown below(1) Execute command-1(2) After the command-1 in (1) is completed,reboot the system (3) Execute command-2(4) After execution of command-2 reboot the sytemIs there a way i can automate this process so that i need not reboot the system manually
View 5 Replies View RelatedI have problems to get it work. i have tried to use pm-utils, but it does nothing.
What is need is to kill application, when pc is going into suspend to ram and run that application again on wake. It's a graphical application.
I have a file with two fields of numbers that I want to use as input for another program.
Code:
The above code does not work, as I think it would take the whole first and second fields as the input for one particular instance of the program 'inputbashangle'. What I want is to get the first two numbers from the first line of the file 'outfailtest', execute 'inputbashangle' with them, then move on to the first two numbers of the second line for all the lines of 'outfailtest'.
Code: cmd='date | wc'
$cmd If this script is executed, an error is generated. The reason written was that "The execution fails because the pipe is not expanded and is passed to date as an argument".What is meant by expansion of pipe. When we execute date | wc on the command line, it goes fine.then | is not treated as an argument. Why?
I have a big bash script ,its goal is to download movie one by one . But I often get into a problem: if this script is executed in cron,it often does not completely download the movie.I often find the movies it downloaded are several KB while the movie is actually 20MB.So I think it is because it did not wait for finishing one task ,and jump to download another.So I want to know ,is there a way to force the bash script to wait until one movie downloaded completely and then start to download another movie ?
View 8 Replies View RelatedI have a script which builds a project and then runs junit tests. However, if the build fails, the junit tests fail with the same error message.Therefore the command which runs the junit tests should only be executed if the build was successful.
View 3 Replies View RelatedI was wondering if it was possible to execute a program from RAM, like having the file data in a bash script variable and then running it.
Something like this:
ls=`cat ls`
$ls
So is it possible to run a program without touching the hard disk and without creating tmpfs or ramfs (it would need to be standard user privileges).
Im trying to install a program with bitrock installer but im asked to logon as root or become super user. When trying to logon as root from logon window I get message that "cant authenticate user" Ive tried to find a place in "users and groups" to become superuser but cant find it.
View 9 Replies View RelatedFollowing is the IDL program found on the internet but i dont know how to compile and execute (even dont know can it be done under linux).
Code:
Assume two applications, Application A and Application B. Both are written in C language.I had tried to use system() function in Application A to execute Application B. It success, but Application A cannot continue its own tasks before Application B exit. I want Application A to execute Application B, but Application A can continue its tasks without waiting for Application B to exit.
View 3 Replies View RelatedI'm trying to execute a C++ program on PowerPC. But I am facing an error saying: "error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory". But a C program gets executed successfully. The programs are cross compiled using PowerPC cross compiler.
View 1 Replies View RelatedI'm building a Cluster with 20 small Compaq ipaq PC's as the nodes. I have absolutely no room for any keyboards on this cluster. The PC's require a keyboard to boot, and there are no BIOS settings I can adjust to fix this problem, and no BIOS updates. I have found a small DOS .com program by Compaq called NO_F1.com it's designed to allow the computer to continue to boot without a keyboard. it's only 172 bytes in size. It sets a bit in the CMOS which allows the boot process to continue without a keyboard. It does not permanently set anything, so it needs to run each time the computer starts.
Is there any way I can execute this program very early in the boot process every time the node boots ? I thought about dissembling the program and trying to modify the boot loader, or some other ASM program, the program is only 172 bytes. But thats really over my head. What could I try, I don't know what to do. Also, I have no floppy drive and no CD drive to boot from, only USB or hard drive.
I am currently trying to set up a media PC running Ubuntu in my living room..I plan to be using XMBC to play my music and videos using a Xbox 360 joypad. I have managed to get 'qjoypad' working so on the desktop the controller controls the mouse, I have also made a little script so that when XMBC opens, 'qjoypad' changes its key mappings to a different profile. However when I exit XMBC, I would like it to return to the default profile, is there any way of doing this?
View 1 Replies View RelatedI would like that my java program continues executing when I close the ssh connection, how can I do that? I suppose I have to create a service, but I have no idea how to do it!
View 3 Replies View RelatedI would to start my computer and right after Linux finishes booting, a terminal automatically is opened and a certain program is started.
View 9 Replies View RelatedI am using RHEL, and trying to execute a c program.I'm able to compile properly and execute until i reach a function getHandle, where the program gives a segmentation fault. Segmentation fault occurs in getHandle().
Here is the code:
I would like to execute an already written C program that I am running on my embedded Linux, but from afar - through a HTML page. I am running an embedded Linux on my FPGA prototype board with a MicroBlaze soft processor. On this Linux i am running a httpd web server - I can serve html web pages to the outside through Ethernet connection. Now, I have a program written in C in this embedded Linux in /bin/gpio-test that does some stuff with my IO devices. Now I would like to control these IO devices through HTML web page - so I would like to be able to run this gpio-test program from a html web page and possibly send the program some parameters.
View 2 Replies View RelatedMy program attributes (it uses semanage to change range): I'd like to ordinary user (bartek) can execute my program. I executed as root:
chmod u+s se_chmod4
so now my user can change his range in permissive mode by my program. My politic: In enforcing mode i can see attributes but when i want to excute i get:
How should look like my TE file that user (bartek) could execute my program (forget at moment about "semanage")?
prohibit execution of any program include shell command, only be profiled program could be executed, can apparmor do that?
View 5 Replies View RelatedI want to execute a program at the very last step of Linux boot process. For Debian based Linux distro that uses BSD boot process, I came up with 2 solutions:
1) I should somehow call my program from the /etc/rc.local script (although is this the last step of the boot process?)
2) Use the "multi_end" and "sysinit_end" hooks for executing it at the end of rc.multi rc.sysinit respectively (I don't know how to do it though).
I've been given one of these ubiquitous usb-sleep buttons which is basically a supersimple usb-keyboard. It's a big button that sends a SLEEP keypress to the computer when you slam it. But that is pretty boring. I'd love to remap it to do something more fun but I can't figure out how to bind to only the sleep press from the button and not from my ordinary keyboard.
The button identifies as
Bus 001 Device 035: ID 1130:600d Tenx Technology, Inc.
I'd like to know if there's either
a way of mapping a key from a specific keyboard to an action OR a way of remapping the sleep key from a specific keyboard to a new key-code or something like that.
I'm running WoW through wine. In order to install addons I need to give all the files in the program permission to execute as a program. the problem is I can't (dont know how) just right click the folder and give everything inside permission i have to open each one and give them all permission, which can quickly turn into hundreds depending on the addon. how to give permission to execute as a program to all the files in a folder at once it would save me a lot of clicking and time.
View 2 Replies View RelatedI have tried to execute the below ns.c program in RHEL 4 by using the command
#gcc -c ns.c -o ns.o
i am not getting any errors but while i am running object file by using the command
#./ns.o
i am getting the below error
bash : ./ns.o cannot execute binary file
/* trinoo daemon */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
[code].....
What is the best program to use to monitor a directory and execute a script when a new file is dropped in the directory? I've searched Google and just can't seem to find what I'm looking for. I would like to execute a shell script after a .CSV file is moved to a certain directory to generate a chart of the data contained in that file. I've got the script, now I only need to know how to execute it when a new CSV file is dropped into the directory. The Linux Distribution is RHEL 5.
View 2 Replies View RelatedA program requires local path property to perform correctly.I'm seeking shortcut command to execute a program with a supplied localPath For example, cd /usr/local/blogrmis/usr/local/blogrmis/remote & remote program requires local path @ /usr/local/blogrmis to run.is there any shortcut which i can do it in 1 line?
View 2 Replies View RelatedI have a machine with 8 cores. I have a directory of input files that I need to process using a non-parallelized program. I would like to write a script that works its way through a list of commands executing 8 commans (i.e., instances of this program; each with specific flags having to do with the current input file) until the list of commands has been exhausted. Is there an easy way to do this?
Code:
hamstrsearch_local-hmmer3.pl -protein -refspec=lotgi_2713 -hmmset=lophotrochozoa_hmmer3 -sequence_file=Aplysia_californica.fas -taxon=ACAL
Is it possible to allow a group/user to execute a command, where one of the parameters of the command is a group as well? example that does not work as intended:
Code:
Cmnd_alias SU=/bin/su -l %group1 This example works sortof, it treats the "%group1" literally. I know I can list out the "/bin/su -l <eachuser>", but as you can imagine that is impractical. In this example, I want people in group2(not shown for brevity sake) to be able to su to someone in group1