unix

query on unix executables

This might be a basic question but i wanted to ask since i am not aware about it. if i have a binary file which was was created on HP-UX and suddenly i take this binary file on linux or let's say in any other platform like AIX or sun solaris and if i want to check about the details of the binary as to in which platform it was developed...

declaring the unix flavour in C/C++

how do i declare in C/C++ that the code that is written is to be built in either HP-UX or solaris or AIX? ...

debugging a makefile

I have a makefile which has statements like below: TOPICS = dmic SRV_MODE = ifeq "$(SRV_FLAG)" "ON" SRV_MODE = 2 endif vpath d%_srv.h $(CNT_PATH) USER_PRE_TARGETS := $(foreach topic,$(TOPICS),$(topic)_srv.h) dmic_srcs = $(wildcard $(CCWSCA)/dmic/src/*.c) \ $(wildcard $(CCWSCA)/dmic/src/*.ppc) dmic_srv.h: $(dm...

Run Xcode tools from the Terminal window

This is something really simple, but I can't seem to find the answer anywhere, and I'm new to both Mac and UNIX, which doesn't help. I've installed Xcode on my mac, along with the iPhone SDK 3.2. I'm trying to run Xcode command utilities that came with the SDK from the unix terminal, but I don't know how to update the paths so that the...

Dreaded Could not reserve enough space for object heap

Im trying to get Solr up and running, at first I had the JDK.1.6 working fine, then tomcat running fine too. All of a sudden when trying to run Solr for the first time however I get the error message: [root@78 bin]# ./java -version Error occurred during initialization of VM Could not reserve enough space for object heap Could not create...

Is the Unix Philosophy falling out of favor in the Ruby community?

David Korn, a proponent of the Unix philosophy, chided Perl programmers a few years ago in a Slashdot interview for writing monolithic Perl scripts without making use of the Unix toolkit through pipes, redirection, etc. "Unix is not just an operating system," he said, "it is a way of doing things, and the shell plays a key role by provid...

syntax error in C

Hi, I am trying to build a block where I am getting this error message pprbc_CONTENT_icverification_act.c", line 99.2: 1506-018 (S) Operand of indirection operator must be a pointer expression Can anyone please explain what this means? code below: *(WORK_migration_ind_f) = *(migration_status_in_MI9_CIRCLE_INFO(WORK_source_cir...

Finding the preferred application for a given file extension via unix shell commands

Hi, this may not be strictly about programming, but if I find no ready-made solution it may become a programming task: On UNIX, what is a command-line method for determining the user-preferred application for a given filetype? My ideal solution here would be a command that stopped me having to do the following: okular foo.pdf And al...

Darwin: how to kill parent process without killing child?

On OS X 10.4/5/6: I have a parent process which spawns a child. I want to kill the parent without killing the child. Is it possible? I can modify source on either app. ...

Running C++ CGI Script As Background Process?

Hi, I'm working on an audio encoder cgi script that utilises libmp3lame. I'm writing in a mixture of C/C++. I plan to have an entry-point cgi that can spawn multiple encoding processes that run in the background. I need the encoding processes to be asynchronous as encoding can take several hours but I need the entry-point cgi to retur...

Basic Questions about Pipes

Hi, I have some basic questions about pipes I am unsure about. a) What is the standard behavior if a process writing to a pipe gets killed (ie. SIGKILL SIGINT) Does it close the pipe? Does it flush the pipe? Or is the behavior undefined? b) What is the standard behavior if a process returns normally? Is it guaranteed to flush the p...

What's a good project tailored to learning strengths of Unix / Linux

I've been developing Microsoft Windows based applications (both desktop and web) for several years using C#, .net, & Visual Studio with a dash of C/C++ & WIN32. I want to broaden my horizons and try out developing in a *NIX environment e.g. using Vim & C++. I have limited UNIX experience from a few school projects. I'm having trouble ...

Unix "wrap" filter

is there one? something I could use like this: $ cat someFileWithLongLines.txt | wrap -80 --indent|less ...

minor issue with fork() and pipe()

I 'm writing a little program that implements pipes like they work in the shell. ie: ls -hal | sort | grep p | wc it works fine, with the minor issue that on one line, when CMD_NO=n, the comparison i biggerthan CMD_NO does not work, but i!=(CMD_NO-1) does. I'm trying to figure out why in this particular case (the line is ocmmented a...

Proper way to set PHP include path for *Nix and Windows

Is this the proper way to define an include path for both *nix and Windows? define( 'INCPATH', realpath( dirname( __FILE__ ) ) . '/' ); Note the trailing forward-slash I included above. Is the forward-slash for includes/requires the same for both OS's, as well? EDIT (UPDATED WITH ANSWER): From what I can gather, my code below is the...

Shared memory for fork

I want to create a shared memory between two process. I used fork(). A child tries to change this shared memory and mother creates another child so new child tries to change same memory so on. here is my code in C programing. (ubuntu) mylist ch=NUL; f=fork(); if(!f){ pba=shmget(KEYSHM,sizeof(char),0); /*created shared memory*/ ...

Unix - how to source multiple shell scripts in a directory?

Hello, when I want to execute some shell script in Unix (and let's say that I am in the directory where the script is), I just type: ./someShellScript.sh and when I want to "source" it (e.g. run it in the current shell, NOT in a new shell), I just type the same command just with the "." (or with the "source" command equivalent) before...

How to create executable coff file from a C source

Hi, I am trying to do a simulate with Simcore Alpha/Functional Simulator and I need to create an image file but it is giving an error like "This is not Coff Executable" how can I create an Executable Coff file from a C source in linux? ...

Why does my process counting script give false positives?

I have the following bash script, that lists the current number of httpd processes, and if it is over 60, it should email me. This works 80% of the time but for some reason sometimes it emails me anyways when it is not over 60. Any ideas? #!/bin/bash lines=`ps -ef|grep httpd| wc -l` if [ "$lines" -gt "60" ] then mailx -s "Over 6...

Any decent scheme implementation that has *no* threading libs?

Hi, I am considering which scheme to use. I would like to use a scheme that has or can be compiled to have no threading support. I have to avoid the layers that threading libs provide. I want an implementation that has no code for interpreter locks, etc. Something that can compile to C is ideal. This will be Unix only. Chicken and Gambi...