On a linux system, does the child process view the existing threads the same way as the parent process ?
int main() {
//create thread 1
.
.
.
int child_pid = fork();
if ( 0 == child_pid)
{
..
}
else
{
..
}
Since the whole address space is copied for the child process, what happens to the state of the threads. What if the thread 1 in...
I have a set of files in a single directory named:
OneThing-x.extension
OneThing-y.extension
OneThing-z.extension
What UNIX command (find, cp, xargs, sed ?) do I use to COPY these into
AnotherThing-x.extension
AnotherThing-y.extension
AnotherThing-z.extension
such that x ->copy-> x, and y ->copy -> y
I have the find .. part of the...
I am using RijndaelManaged to make a simple encryption/decryption utility. This is working fine, but I am trying to get it integrated with another program which is created in Unix (Oracle). My problem is, for all smaller input string, i am getting the exact same encrypted hex as the Unix code is generation, but for longer strings, half o...
I am creating a Python script within which I am executing UNIX system commands. I have a
war archive named Binaries.war which is within an ear archive named Portal.ear
The Portal ear file resides in, say /home/foo/bar/
jar xf /home/foo/bar/Portal.ear Binaries.war
Will extract the Binaries.war file out of the /home/foo/bar/Portal.ear ...
is it possible to mount a local directory into another one. Using perfoce I want to do something equivalent to symlinking a directory, but in a way that fools it into thinking it's really just another directory in the project.
I would like to do something like:
mount /foo/bar /home/foo/bar
Is this possible, and if so what options...
I've seen a number of question's closed as "Not programming related" (e.g. http://stackoverflow.com/questions/397854/what-process-accesses-my-hdd)
I understand that their's several alternative site (stackoverflow) themed-forums and to attempt keep site question's to a minimum also some may argue that this is too subjective, o well, I go...
There are multiple files in a directory that begin with prefix fgh, for example:
fghfilea
fghfileb
fghfilec
I want to rename all of them to begin with prefix jkl. Is there a single command to do that instead of renaming each file individually?
...
I am working tools that will be used on the multiple OS and platform. This tools will provide the details of the OS on which it is running, like 32 bit or 64 bit OS, exact version of Linux,Solaris,or other OS.
One way I am thinking of using the "uname -a" command to extract the OS information on the Linus/Unix based OS. Please suggest m...
Hi all,
Started to learn some shell scripting. I have a perl script that runs on one file. How would I write a shell script to run the perl script a bunch of times on all files with keyword "filename" in it?
So in English,
for /filename/ in filenames
perl myscript.pl completefilename
Thanks,
Michael
...
I am looking for a Java library to interface with standard Unix functions, i.e. stat(), getpwuid(), readlink().
This used to exist, and was called javaunix. It was released back in 2000. See this announcement. But the project page is now gone.
Is there any modern replacement for these types of functions in Java today? One could mak...
We have a small daemon application written in C for a couple of various UNIX platforms (this problem is happening in SunOS 5.10), that basically just opens up a serial port and then listens for information to come in via said port.
In this particular instance, the daemon appears to read a single transmission (like a file's worth of data...
Hey everyone,
I have created a shell script to backup my webfiles + database dump, put it into a tar archive and FTP it offsite. Id like to run it X times per week however I only want to keep the latest 10 backups on the FTP site.
How can I do this best? Should I be doing this work on the shell script side, or is there an FTP command t...
Why is
1 January 1970 00:00:00
considered the epoch time?
...
How do I get a process list of all running processes from Python, on Unix, containing then name of the command/process and process id, so I can filter and kill processes.
...
I'm trying to use something along the lines of
unexpand -t 4 *.php
but am unsure how to write this command to do what I want.
Weirdly,
unexpand -t 4 file.php > file.php
gives me an empty file. (i.e. overwriting file.php with nothing)
I can specify multiple files okay, but don't know how to then overwrite each file.
I could use ...
I'm working on an old variant of unix (qnx 4.x to be exact). I'm trying to shoe-horn in modern software methodologies atop 20+ year old technology. In short I need a unit testing framework for QNX.
Keep in mind we've got a bare bones C compiler and that's pretty much it. Anyone got any suggestions on how I can unit test this beast?
...
My Python utility script contains UNIX system calls such as
status, output = commands.getstatusoutput("ls -ltr")
print "Output: ", output
print "Status: ", status
Which work fine and print the output to the console but as soon as I run Maven from the same script,
status, output = commands.getstatusoutput("mvn clean install -s./../.....
Hi
I have 2 processes P1 and P2. P1 is running as root, and is creating a semaphore with the following call:
semget (key, 1, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH | IPC_CREAT);
and am trying to get the handle to the same semaphore in another process P2, which is running under the normal user's context. In this proce...
Hi,
How to get the current date value in epoch i.e., number of days elapsed since 1970-1-1. I need solution in unix shell script.
...
This shell script is used to extract a line of data from $2 if it contains the pattern $line.
$line is constructed using the regular expression [A-Z0-9.-]+@[A-Z0-9.-]+ (a simple email match), form the lines in file $1.
#! /bin/sh
clear
for line in `cat "$1" | grep -i -o -E "[A-Z0-9.-]+@[A-Z0-9.-]+"`
do
echo `cat "$2" | grep -m 1 ...