Programming :: Sort Of Execv Command Needed?
Jul 2, 2010
I have a problem, I need to launch another binary from my application, but I need to get the control back once the other binary is initialized. fork/exec doesn't seem to give anything on that side using pthreads I'm able to wait until the new thread exits, but that's not what I want at the moment I'm using popen, but it doesn't seem to do the job right...
View 14 Replies
ADVERTISEMENT
Feb 28, 2010
What options should I use when I'm using the sort command to sort the top 5 CPU processes (ps -eo user,pid,ppid,%cpu,%mem,fname | sort ??? | head -5) showing max to min usage?
View 2 Replies
View Related
May 4, 2010
We switched from unix to linux and we have an old report that extracted data from a database, output to an ascii file and then sorted the results in the file based on different arguments. The report now blows up when it runs,and I can only guess it is because the options for sort on linux differ slightly from unix.For example, here is one of the commands issued from within the report app that ran on the old unix box:
if sort-sequence = "descending" then
'sort -t~" -f +3.0f -4.0 +5.0r -6.0 -f '
else
'sort -t~" +3.0f -4.0 +1.0f -2.0 -f'
I will eventually rewrite the report to store the data in a local table, but I can simply adjust the options to suit the requirments of linux. Basically, I need to know if this can be a quick fix for the short term.
View 2 Replies
View Related
Mar 8, 2011
I need to disable file access (fopen, freopen, open etc) for application which is running under chroot jail and with restrictions (rlimit) via execv. Before that I redirected stdin/out to files within jail. I tried this:
Code:
// Redirect stdin/stdout to files
int fd = open (file_input, O_RDONLY);
if (fd < 0)
fatal_error ("input open failed!");
[Code].....
View 6 Replies
View Related
Jan 6, 2011
I haven't programmed in C for a while, so I am trying to remember certain aspects of syntax. I have a program that will fork and exec other programs. Those programs will be specified on the command line as follows:
./main "prog1 arg arg ..." "prog2 arg arg ..."
Here is the main snippet:
int countChar(char* s, char c)
{ int cnt = 0;
int len = strlen(s);
for(int i = 0; i < len; i++)
[code]....
The highlighted line is the problem. I get this error:
dualstarter.cpp:58: error: initializer fails to determine size of 'params'.
Right now I am thinking of creating an array with the specified size and simply copying the required string into it, but it just seems like there is an easier way.
View 9 Replies
View Related
May 17, 2010
When I try to invoke 'source' command from within a shell script, namely, myscript.sh, I get the following error message code...
View 1 Replies
View Related
Mar 18, 2010
Here is what I am doing I have a file, a.txt for example, with following contents:
Code:
coreutils install
cpio install
cpp install
cpp-4.3 install
dbus install
[Code]...
So it seems like the sorting algo. for dpkg --get-selections is different than sorting algo. of 'sort' command when it encounters "-" (hyphen). How can I sort the original file (a.txt) in such a way that it produces the output file ,b.txt, exactly the same.
View 6 Replies
View Related
Jan 27, 2010
I can't find a Yum command to clean up no longer needed dependencies, you know similar to apt-get autoremove. Or does yum do this with the erase or remove command? btw: yum-clean-all just flushes out the cache right?
View 2 Replies
View Related
May 11, 2010
An app failed to load properly and now i'm stuck in a sequence I don;t understand the solution for.
sudo apt-get autoremove
dpkg was interupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
View 1 Replies
View Related
Dec 1, 2010
I have set up a user to login remotely to our Red Hat 5 server via SSH. A rule in our department firewall enables this user to login from a single static ip address. The ssh port on our server is 22. I am able to login to port 22 from locations within our department firewall. Our administrator says the firewall configuration is unchanged. The remote user had been successful logging in. But now the remote user gets a Connection Timed Out message, before being asked to authenticate by the server.
I regenerated security keys, but the remote user still gets the connection timed out message. (I can login locally with the new keys). I suspect either a firewall or an authentication problem--inclining a firewall problem. Am I correct? Is there a Linux command to check whether port 22 is available or blocked, prior even to authentication, for login from the user's remote location?
View 3 Replies
View Related
Feb 2, 2011
My make file has the following lines:
blah blah
INCLUDES= -I./src
-I./include
-I$(PROJECTPATH)/myproject/libs/liburi/include
LDFLAGS+= -L$(PROJECTPATH)/myproject/libs/liburl/
[code]....
The LDFLAGS specifies the library path, which is specified as -L$(PROJECTPATH)/myproject/libs/liburl/ When I check this directory on my machine I see that the file: liburi.so.1 is indeed there.
View 1 Replies
View Related
Sep 4, 2010
I need a person to look over and test the security of a program that I am writing. It is in its final stages so no major bugs should be in it. You have to be good in C programming, and know how encryption works. Being knowledgeable in security is a plus. Email me at <removed> or message in post if you are interested.
View 4 Replies
View Related
Jul 26, 2010
i have an application that launches several pthreads, i know that the default size used by Linux is 8Mb for each pthread. However i would like to optimize the total memory usage by my application by decreasing the default stack size of each pthread to the needed resources. My questions:
- Are there any rules to set the pthread stack size.
- How to compute the memory needed by each thread.
- Is the malloc call inside a thread counted from the stack size of the same pthread?
View 2 Replies
View Related
Jun 18, 2010
i'm trying to follow this guide: [URL] (THE GUIDE AT THE BOTTOM OF THE COMMENTS, NOT THE GUIDE IN THE OP) EDIT: Managed to install the GUI XHydra, but when I tested it out I get this error:
[Code]..
View 2 Replies
View Related
Dec 21, 2010
I am reading a tool manual and it instructs to use such a command:
Code:
Especially, what does the 'sort' parameters and awk do?
View 8 Replies
View Related
Jul 15, 2010
It sure looks not quite sorted to me. See lines 3 and 4.
Code:
altair/root /root 250# sort -k1 < files.out | head -6
/bin base-files
/bin bash
/bin/bash bash
/bin bsdutils
[Code]...
View 9 Replies
View Related
Dec 9, 2009
I've been using linux for a long time, and I just ran into a problem that has me stumped. Any time I mistype a command, it says "Command not found."... yea, I know that's normal. But it doesn't return me to my # prompt. I have to press Ctrl+C to get back. code...
I know I do have one issue with this computer, I have 2 blown caps on my motherboard. This was a dual boot system, but after a virus with winblows, I decided to switch it to strictly linux. (roommates... *grumble*) I think I was running fc10 before I wiped the hd & installed fc12. Fc12 does seem to be running slower, and I still haven't got my sound card working properly... but that issue is for another topic...
-YungBlood Reborn
View 2 Replies
View Related
May 14, 2010
What is the command to sort a text file by the second word?
View 4 Replies
View Related
Feb 27, 2011
I'm learning GTK , and would like to use Codeblocks, and/or KDEvelop, and compile my c files using that, but always get an error about gtk/gtk.h not found, but can't figure out how to add the commands... I normally type gcc -o Program1 main.c `pkg-config --libs --cflags gtk+-2.0` That's a lot to type every time to compile.. Isn't there an easier way, in KDevelop, Monodevelop, and/or Codeblocks to make this step quicker, by adding some sort of I-/usr/include commands, or something?? thanks in advance, =). I looked online for some results, but didn't come across anything handy..
View 1 Replies
View Related
Aug 25, 2010
I am executing the script.
with help of cron job but it is not executing in cron job.
i check owner and chmod and create the file and execute manually it is working fine but in cron job i set below
Crontab -e
8 14 * * * /home/tplinux/webapp/tpadminhost/collect_ejxml/ejrename.sh
wq!
after that wait till that time but script is giving message no such file in directory but same thing is excute manually it is running fine and found the files.
Below is my script details
file name ejrename.sh. code...
View 3 Replies
View Related
Jan 27, 2010
I have program like this:
Code:
with 'gcc -g' it runs well, but with 'gcc -g -O3' (with -O2 too) it crash.
output is something like this:
Code:
and gdb says
Code:
Why it try to compare something at address 0x209 when this address is not in the vector?
View 1 Replies
View Related
May 5, 2010
i have text file that filename contain the date of creation (i.e 2010.05.02.log).I would like to create a script that:-Ask for start date -Ask for end date- Concatenate all file on the requested period by date order.
View 1 Replies
View Related
Feb 17, 2011
Please I want Know the code of the Merge Sort with threads in C
View 7 Replies
View Related
Apr 4, 2010
I am trying to get the title of all the windows that i open,but cant make it right... code...
the problem is,that it will write the current windows many times,until i open another window,and so on.
View 1 Replies
View Related
Dec 1, 2010
I have a hash of hashes and I need to sort this by value and write to a javascript array file..Currently I am using the following
foreach my $key(sort { keys %{$trans{$a}} <=> keys %{$trans{$b}}} keys %transmission)
{
foreach my $role(sort {$trans{$key}{$a} cmp $trans{$key}{$b}} keys %{$trans{$key}})
[code]...
View 2 Replies
View Related
May 5, 2010
I am trying to import variable values from a profile file to a perl program.
I am using the below command for doing it.
Quote:
system (". /opt/bbfb/bin/setbbfbenv $codeset");
the above command does make variable values available to the running perl program..
Can some one help me on this front..
View 1 Replies
View Related
Apr 30, 2010
I have a multi-dimensional array like so:
Code:
Array (
[0] => Array (
[0] => Eleven
[1] => NumberEleven
[2] => 11 )
[1] => Array (
[0] => Twelve
[1] => NumberTwelve
[2] => 12 )
[2] => Array (
[0] => AnotherEleven
[1] => Eleven,Again
[2] => 11 )
I need to sort it by array[ $key ][ 2 ] so that it is sorted like so:
Code:
Array (
[0] => Array (
[0] => Eleven
[1] => NumberEleven
[2] => 11 )
[1] => Array (
[0] => AnotherEleven
[1] => Eleven,Again
[2] => 11 )
[2] => Array (
[0] => Twelve
[1] => NumberTwelve
[2] => 12 )
I've looked at the php array docs the closet thing I found was array_multisort which won't work for my above requirements, does anyone have any insight to how to sort this way?
View 3 Replies
View Related
Mar 10, 2009
Using PHP 5.x. I would like to sort a set of values first numerically, then alphabetically. For example, here's my code so far:
Code:
<?php
print "<p style="font-family:verdana;font-size:10pt">
";
$myArray = array("1223:starfruit", "34112:oranges", "1223:zucchini", "321:apples", "34112:pears", "1223:tomatoes");
[code]....
I have fiddled with array_multisort but I can't seem to get my head around it or the many sort routines in PHP.
View 3 Replies
View Related
May 10, 2010
Here's my code for bubble sort with double type
Code:
#include <stdio.h>
void swap_double( double *a, double *b )
{
double _t = *a;
code....
View 1 Replies
View Related
Mar 23, 2011
I'm searching for an algorithm to sort a binary min heap tree. That's when in root i have the smallest value in the tree. The only restriction it has, is that the parent must be smaller the its two children. i think something like quick-sort, but i don't know how to implement it.
View 8 Replies
View Related