I'd like to call the first command listed in a simple text file with \n as the separator in a pop-like fashion:
Figure 1:
cmdqueue.lst :
proc_C1
proc_C2
proc_C3
.
.
Figure 2:
Pop the first command via popcmd:
proc_A | proc_B | popcmd cmdqueue.lst | proc_D
Figure 3:
cmdqueue.lst :
proc_C2
proc_C3
proc_C4
.
.
...
What are the trade-offs between using a System V and a Posix semaphore?
...
I currently use this function to wrap executing commands and logging their execution, and return code, and exiting in case of a non-zero return code.
However this is problematic as apparently, it does double interpolation, making commands with single or double quotes in them break the script.
Can you recommend a better way?
Here's the...
I'm scared that one day, I'm going to put a space or miss out something in the command I currently use:
rm -rf ./*
Is there a safer way of emptying the current directory's contents?
...
I'm sure I once found a unix command which could print the common lines from two or more files, does anyone know its name? It was much simpler than diff.
...
I could replicate the problem with various shells under FreeBSD, GNU/Linux, and Solaris. It had me head-scratching for more than an hour, so I decided to post the question here.
...
I've a process name and I've to send a kill() signal to that process but I need its PID to call kill(). I would only like to use:
popen("pidof process_name");
as the last thing. Is there any other way to find out the process' PID? One way I could think of is to send a socket request to that process and ask to its PID.
The other way i...
In a UNIX shell script, what can I use to convert decimal numbers into hexadecimal? I thought od would do the trick, but it's not realizing I'm feeding it ASCII representations of numbers.
printf? Gross! Using it for now, but what else is available? :)
...
I have some data files to import into a database with some "unique" delimiters:
Field Separator (FS): SOH (ASCII character 1)
Record Separator (RS) : STX (ASCII character 2) +’\n’
I'd like to import the files into Postgres using the COPY command but while I can specify a custom field delimiter, it can't handle the record separator.
I...
This just occurred to me in answering another question. Can anyone recommend any good, current, systems programming books, for really any variant of UNIX? Such a book would teach file and directory structure, fork/exec, pipes, FIFOS, and semaphores. I'd think (looking back on my similar course) that a reasonable final project would be...
I am working on a UNIX box, and trying to run an application, which gives some debug logs to the standard output. I have redirected this output to a log file, but now wish to get the lines where the error is being shown.
My problem here is that a simple
cat output.log | grep FAIL
does not help out. As this shows only the lines which ...
I manage Unix systems where, sometimes, programs like CGI scripts run forever, sometimes eating a lot of CPU time and wasting resources.
I want a program (typically invoked from cron) which can kill these runaways, based on the following criteria (combined with AND and OR):
Name (given by a regexp)
CPU time used
elapsed time (for pro...
I know this is a simple question, I'm just curious.
...
I know this is supposed to output what kind of shell I'm using, which I think it does, because it outputs "bash-3.2", but it doesn't quite do that, because it actually changes my prompt to "bash-3.2$". What else is going on? When I do Ctrl+D, I go back to my original prompt. Is this starting the bash shell? I thought by opening a ter...
Mostly for my amusement, I created a makefile in my $HOME/bin directory called rebuild.mk, and made it executable, and the first lines of the file read:
#!/bin/make -f
#
# Comments on what the makefile is for
...
all: ${SCRIPTS} ${LINKS} ...
...
I can now type:
rebuild.mk
and this causes make to execute.
What are the reasons fo...
How can I tell unix "find" to include in it's recursive search a folder which is softlinked?
...
What is the preferred way to create a background task for a Rails application? I've heard of Starling/Workling and the good ol' script/runner, but I am curious which is becoming the defacto way to manage this need?
Thanks!
Clarification: I like the idea of Rake in Background, but the problem is, I need something that is running constan...
I recently switched over to a MacBook Pro so I'm still really new at Mac software ecosystem. What is the best guide or what tips do you have to quickly get adept at using Mac for developing on both Mac/Unix and MS platforms (*.NET, SharePoint, SQL Server, etc) using VMWare Fusion? For example, I've setup NetBeans, FlexBuilder, Eclipse, T...
If i need to find out the size of a tcp packet on BSD.....what do we need to do?
Is there some utility which allows for this?
...
The server I'm trying to maintain is sassing me.
Among other things, I ran tload. This probably provides helpful information to someone who knows how to read this data. I do not.
It says:
1.36, 1.12, 0.59 -------------
What should I glean from this? This is our home-grown stat server, it gets a crap-ton of requests, and runs logr...