unix

what is /dev/windrvr6

What is /dev/windrvr6 Is this a generic driver? I have 2 card made by different vendors using /dev/windrvr6 and they seem to work fine. Will this be a problem in the future? ...

Request a webpage with Cron

I have an MVC architecture and since I already have an action that would be extra useful if automatically called every hour or so, I wondered if there's a way to set it up as a cron job? ...

Command line command to auto-kill a command after a certain amount of time.

I'd like to automatically kill a command after a certain amount of time. I have in mind an interface like this: % constrain 300 ./foo args Which would run "./foo" with "args" but automatically kill it if it's still running after 5 minutes. It might be useful to generalize the idea to other constraints, such as autokilling a process ...

What unix command can we use to append some text to a specific line in a file?

Does anyone know of a series of unix commands that allows someone to append some text to the end of a specific line in a file? eg Line 1 Line 2 Line 3 Line 4 I wish to append the text ", extra information" to Line 3 so that the File will now look like this: Line 1 Line 2 Line 3, extra information Line 4 ...

Where to set LD_LIBRARY_PATH on solaris?

What is the best place to set up application specific LD _LIBRARY _PATH variable on solaris? How does LD_LIBRARY_PATH variable work? We currently set it up in .kshrc, but different applications need different versions of messaging framework, but these applications run under the same use and hence they would need different LD_LIB...

How do I pass arguments to shell script?

I have a batch file like this: java temptable %1 %2 I need the equivalent shell script for the above. I will pass the arguments to the shell script and that should be passed to temptable. ...

How do I get the path of a process in Unix / Linux

In Windows environment there is an API to obtain the path which is running a process. Is there something similar in Unix / Linux? Or is there some other way to do that in these environments? ...

Using expect to login into SVN

I am trying to use an automated script, which would login to SVN, update my sources, create a tarball with these and scp them to a remote host. The problem here is that, for every login to SVN (even for checkout or update), we require to enter our password. Automation of password entry, the only way that I could find, was using expect t...

How can I programmatically create a new cron job?

I want to be able to programatically add a new cron job, what is the best way to do this? From my research, it seems I could dump the current crontab and then append a new one, piping that back into crontab: (crontab -l ; echo "0 * * * * wget -O - -q http://www.example.com/cron.php") | crontab - Is there a better way? ...

Packaging to use to deploy cross-platform?

On windows applications are typically packaged as MSI, on Redhat Linux as RPM, what would be a best open source packaging method that could be used to deploy applications to all platforms including different flavors of unix and windows? Contents would include exes, unix binaries, java jar files, user data, even database scripts to be ru...

_splitpath in linux

Is there a linux equivalent of the win32 API _splitpath in linux? Details added: void _splitpath ( const char *path, // Path Input char *drive, // Drive : Output char *dir, // Directory : Output char *fname, // Filename : Output char *ext // Extension : Output ); It takes full path as...

How do I find my program's main(...) function?

Hi, I am currently porting a project with a few hundred code files and dependencies onto several third-party libraries to Mac Os. I've finally gotten to the point where the program compiles without warnings or errors, but it does not seem to execute my own main function. Instead it seems to execute some other main function which seems...

CreateThread vs fork()

Do we have any sort of relationship between fork() and CreateThread? Is there anything that CreateThread internally calls fork()? ...

Providing Documentation for an Unix command?

I made an Unix command called macmac2unix, which converts a Word file from Mac to Unix. How can I provide documentation for my command? I want to read about my command with man $man macmac2unix ...

Heap corruption in HP-UX?

Hello, I'm trying to understand what's going wrong with a program run in HP-UX 11.11 that results in a SIGSEGV (11, segmentation fault): (gdb) bt #0 0x737390e8 in _sigfillset+0x618 () from /usr/lib/libc.2 #1 0x73736a8c in _sscanf+0x55c () from /usr/lib/libc.2 #2 0x7373c23c in malloc+0x18c () from /usr/lib/libc.2 #3 0x7379e3f8 in _fi...

Executing own Unix command in terminal?

I made an Unix command, macmac2unix, which converts Mac's Word file for Unix platforms. I would like to run the command as $macmac2unix file1 file2 file3 ... Problem: How can I run this command in every path? I added the following to .bashrc unsuccessfully CDPATH=:/Users/Sam/Documents/Unix ...

How do you pass arguments (I.E. the binarys name) to the Emacs gdb command?

Right now, I have F5 set to start gdb in emacs for me: (global-set-key [f5] 'gdb) This switches to the mini-buffer, which I then type a path to an executable... I'd like to find a way to bypass this path typing... I wrote an executable that looks at the Makefile, parses it and figures out the full path of the executable and prints it ...

Comparing Mac's and Unix manuals?

How can I list differences between Mac's and Unix manuals? For example, between the following commands uniq guniq I tried the following unsuccessfully diff (man uniq) (man guniq) ...

Applying AWK on Set of Files with Same Extension

I want to apply the following "awk" command on files with extension "*.txt" awk '$4 ~ /NM/{ sum += $2 } END{ print sum }' But why this command doesn't work: for i in *.txt do echo awk '$4 ~ /NM/{ sum += $2 } END{ print sum }' $i; done Normally, awk '$4 ~ /NM/{ sum += $2 } END{ print sum }' file1.txt would work. ...

Does any Unix-like system ascribe meaning to the SUID bit on a directory?

As the title says, does any Unix-like system ascribe a meaning to the SUID bit on a directory, and if so, what does it mean? The SVTX (saved text, or sticky) bit has a meaning - thou shalt not delete a file from this directory unless you can write to the file. It is used on /tmp, for example. The SGID (set GID) bit has a meaning - fil...