unix

c#: transform a string targeted for the unix shell use for the windows command prompt.

Here is a sample string I got off a socket stream. \033[H\033[J\033[1;30HSUPERVISOR MAIN MENU\033[6;5H 0. Exit Exit\033[7;5H 1. Help Display help\033[8;5H 2. Control Calling lists and users\033[9;5H 3. Campaign Campaigns\033[10;5H 4. Manage If you want to see the output I expect open a unix/linux shell, t...

Unix-Compare two folders which has many files inside contents

Have two folders with approx. 150 java property files. In a shell script, how to compare both folders to see if there is any new property file in either of them and what are the differences between the property files. The output should be in a report format. ...

Adding something to ruby loads path

I want to add a folder ~/Projects/Scripts so I can use require script where script is a ruby file in this directory. How does the require ruby method works? Does it load from a enviornment variable and if so what? ...

strings.h and wrapping this macro with a macro check of whether

I infer from Google search results that strings.h (from here) is for UNIX systems. I would like to wrap the following line with a macro check of whether the host's operating system is Linux/UNIX. It would be much appreciated to hear suggestions about it. Thanks in advance. #include <strings.h> ...

Creating .so and .a in UNIX

How to create a .so and .a file in UNIX. Do we have any standard utility for it? ...

Removing all files from a folder with by searching for a string in unix

Hello all, I'm working on a solaris box. How do I go about deleting all files in a folder, which have the word"Failure" in them ? i'm trying something in the lines of the following, but it doesn't seem to remove anything. rm -rf | find ./*.log -exec grep 'Failure' \; Appreciate your inputs. ...

strtok and execlp in a mini-shell

Hi fellows! I'm writing a mini-shell to get more familiar with Unix process management in C. It's reading stuff from commandline and passes these arguments via execlp to the system. # include <stdio.h> # include <stdlib.h> # include <unistd.h> #define MAXSIZE 100 char prompt[MAXSIZE]; int main(void){ pid_t pid; printf("> ...

ICL, OS X.4/5 and Unix compliance ($UNIX2003)

Hi all, I'm trying to compile a Mac version of our lib for a customer that wants to include it in a Photoshop plugin, and he is having trouble linking our lib into his app. More detailed info: His plugin is built against the CS4 Photoshop SDK, which means the Mac OS base SDK should be 10.4. My lib is a static one, compiled with the Inte...

foreach no match -C shell script

I’m trying to write my first script to search for a given pattern in text file named test. Here is the script: #! /bin/csh echo -n "enter pattern: " set pattern = $< foreach word (`cat test`) echo $word | egrep $pattern end When I try to run it I get the message foreach: No match found. I suspect the problem is ca...

/usr/share/zoneinfo epic fail

I have just, in my groggy morning state, reversed & confused the arguments to ln, replacing /usr/share/zoneinfo/America/Toronto with a link to the non-existant /etc/localtime, when I really wanted to link /etc/localtime to Toronto. Now I have no timezone file for where I live. Does anybody have a copy or know where I could get one? It's ...

iPhone Dev: Working with unix time?

I'm actually working with fbconnect and I'm trying to get a unix time that represents a month ago. I'm really confused about this since 1970 thing. Cause some body give me a point in the right direction? ...

PYTHONPATH environment variable...how do I make every subdirectory afterwards?

I currently do this: PYTHONPATH=/home/$USER:/home/$USER/respository:/home/$USER/repository/python-stuff How can I make it so that the PYTHONPATH can include everything subdirectory? PYTHONPATH = /home/$USER/....and-all-subdirectories ...

Platform independant resource management

Hi, I'm looking for a way to embed text files in my binaries (like windows resource system). I need something thats also platform independant (works in windows and linux). I found qt resource management to be what I need but Im not keen on my app depending on qt for this alone. I also found this tool at http://www.taniwha.com/~paul/res/...

How do I use the C date and time functions on UNIX?

Jon Skeet spoke of the complexity of programming dates and times at the 2009 DevDays in London. Can you give me an introduction to the ANSI C date/time functions on UNIX and indicate some of the deeper issues I should also consider when using dates and times? ...

Monotouch - Ibtool does not exist in any folders referenced in the PATH environment variable

I've just installed monotouch and having a problem with my first build of an unchanged IPhone template project. The build is not finding Ibtool in any of the folders in the PATH environment variable. I get the following message : Build failed. ApplicationName='ibtool', CommandLine=.... If I do a search for Ibtool, it is in folder...

C fopen vs open

Is there any reason (other than syntactic ones) that you'd want to use FILE *fdopen(int fd, const char *mode); or FILE *fopen(const char *path, const char *mode); instead of int open(const char *pathname, int flags, mode_t mode); when using C in a Linux environment? ...

How can I display rsync progress from a log file without the carriage returns?

I have a log file from rsync command with progress on. When running this progress updates the display information on the same line. When I capture the output from this command I get a file that displays normally with cat on a terminal (all the backspaces and re-edits are replayed) but I want to be able to use grep on the file and proc...

How do I read a directory as a file in Unix?

I understand that a directory is just a file in unix that contains the inode numbers and names of the files within. How do I take a look at this? I can't use cat or less on a directory, and opening it in vi just shows me a listing of the files...no inode numbers. ...

Getting error while linking an OCCI program on AIX

Hi All , I have written one sample program for connecting Oracle in C++ using OCCI.. It is giving me a runtime error . ld: 0711-317 ERROR: Undefined symbol: .oracle::occi::Environment::createEnvironment(oracle::occi::Environment::Mode,void*,void*(*)(void*,unsigned long),void*(*)(void*,void*,unsigned long),void(*)(void*,void*)) ...

Comparing strings for equality in ksh

Hello, i am testing with the shell script below: #!/bin/ksh -x instance=`echo $1 | cut -d= -f2` if [ $instance == "ALL" ] then echo "strings matched \n" fi It's giving this error in the if condition: : ==: unknown test operator is == really not the correct syntax to use? I am running on the command line as below test_lsn_2 INST...