I'm creating various processes (3 to be precise) and making them do different things.
So far so good. I'm trying to wait in the parent until all children are completed. I've played around with many options (such as the one listed below) but either the parent waits but I have to press enter to return to the shell (meaning that some child...
hi I'm trying to understand system calls: directories and files on unix, .. I found this website where they explain some calls with their own examples, but do not understand these code snippets ..
void state (char *file)
{
struct stat buf;
struct passwd *pw;
struct group *gr;
int i;
if (stat(file, &buf)...
How to use loop statements in unix shell scripting for eg while ,for do while. I'm using putty server.
...
I'm writing some code for testing multithreaded programs (student homework--likely buggy), and want to be able to detect when they deadlock. When running properly, the programs regularly produce output to stdout, so that makes it fairly straightforward: if no output for X seconds, kill it and report deadlock. Here's the function protot...
is there a way to search and replace a string using single unix command grep recusrsively in multiple directories?
i know it can be done by using the combination of find with other utilities like sed perl etc.but is there a way where we can use only grep for doing this on unix command line?
...
I'm trying to load my daemon-app with this command launchctl load /Library/LaunchDaemons/myPlistFileName It works fine, but only while my user is logged in on system.
How can i load my deamon-app, which will stay loaded without any user logged into the system (like the windows-services)??
The command sudo launchctl load /Library/Launch...
svn up
svn: Error writing to '.'
svn: Can't write to file '.svn/tmp/entries': No space left on device
If my box is out of hard drive space, that is impossible, becauase it has 620GB of HD.
...
Hi,
I have a directory filled with files with random names. I'd like to be able to rename them 'file 1' 'file 2' etc based on chronological order, ie file creation date. I could be writing a short Python script but then I wouldn't learn anything. I was wondering if there's a clever 1 line command that can solve this. If anyone could poi...
Suppose I want to get several of a file's properties (owner, size, permissions, times) as returned by the lstat() system call. One way to do this in Java is to create a java.io.File object and do calls like length(), lastModified(), etc. on it. I have two problems so far:
Each one of these calls triggers a stat() call, and for my pur...
I read in my unix text book that bss is used to store the uninitialized variables(global declarations). This would mean that the static variables are stored separately and not in the bss. The only other place is the data segment.
Here is my question: Is bss segment a part of the data segment or are they two entirely different set of me...
I want to make SVN ignore everything that is in my wordpress directory. It bring me nothing but headaches because of auto updates to plugins etc.
When I...
svn propedit svn:ignore ./blog
It tells me...
svn: None of the environment variables SVN_EDITOR, VISUAL or EDITOR is set, and no 'editor-cmd' run-time configuration option was f...
Hello,
I have following problem. I want to create a file system based session storage where each session data is stored in simple file named with session ids.
I want following API: write(sid,data,timeout), read(sid,data,timeout), remove(sid)
where sid==file name, Also I want to have some kind of GC that may remove all timed-out session...
How do I write a rewrite-rule that redirects visitors to the domain www.mydomain.com/ to www.mydomain.com/index.html?
...
Hi all,
Is it possible to make system call in Objective-C?
I have the following code:
if (!system("ls -l")) {
NSLog(@"Successfully executed");
} else {
NSLog(@"Error while executing the command");
}
How to get the output?
Thanks
...
I have a hanging comma at the end of a file that I would like to replace with a close square bracket. There may or may not be a newline character at the end of the file as well. How can I replace the one or two characters with the square bracket using common unix tools?
...
I've seen somewhere that we can use >> in shell.
What's the difference between using > and >> in shell?
...
I have ported a fair bit of code from Win to Solaris, one of the issues I have -
I am getting a heaps of warnings:
Warning: Last line in file is not terminated with a newline.
I like warnings - but because of the sheer amount of those I am afraid I could miss more important one.
Which compiler (cc) option should I specify to silence...
I have a bunch of files in a directory. I want to zip some of them together into a zip archive.
I can see there are various solutions for doing so. I could use a gem such as rubyzip or run exec and just use a command line tool.
This is going to impact an important part of the system I'm working on so I'd love to have some feedback and...
I need to create a Java util that will recurse its way through a Unix (and/or Linux) filesystem and build an object model of the directory structure, retrieve file info - size, created date, last accessed date etc - plus I need to retrieve info on the physical storage device the files are sitting on. Ideally, this util will be portable. ...
I was trying to make cat1.txt as a variable ($2) so that it will be inserted in sql select statement. Is there a way to do this?
my cat1.txt
1111
2334
2234
3333
4444
....
....
etc.
my SQL Statement
set echo off linesize 280 pagesize 0 newpage 0 feedback 1 verify off head off trimspool on
alter session set sort_area_size=10485760...