unix

Free Unix Shell with open port ?

Hi,I'm in a restricted network,that way I'm looking for a free Unix shell with open port to use SSH tunnelling (remote port forwarding) and thanks. ...

How can I run my program code after fixed intervals?

I have this Perl script for monitoring a folder in Linux. To continuously check for any updates to the directory, I have a while loop that sleeps for 5 minutes in-between successive loops : while(1) { ... sleep 300; } Nobody on my other question suggested using cron for scheduling instead of a for loop. This while construct...

recon reports: compare two reports and display the difference.

hello folks., I need a tool to compare two report files and display all difference as a html file. Eg: There is recon report generated in URL, http://machinename.reports. When opened this Url, it should display the similarities and difference of 2 xml files. ...

Mac web sharing: default directory listing name length

I'm sharing a folder over the web using Mac's Web Sharing. Some file names are long and they are concatenated. How do I change the default directory name listing length on a Mac? ...

Problems compiling file on School's Unix System

COMPLETE EDIT BUT SIMILAR PROBLEM What's the best software/plugin to enable FTP on Eclipse? I'm using FileZilla, but is there something better/easier? ...

How to convert a decimal into binary and vice versa

Hi how to convert Decimal to binary and viceversa i am working on solaris10 platform can anybody help me with a command Decimal to Binary 4000000002-100000000000000000000000000010 Binary to decimal 100000000000000000000000000010-4000000002 ...

Printing lines from a file where a specific field is matched

Hi, I have many lines of form: A:B:C I want to print those lines(complete) where the 3rd field (fields separated by :) contain a certain pattern. Example: new/old:california/new york:/ms/dist/fx/PROJ/fx/startScript new/old:startScript/new york:/ms/dist/fx/PROJ/fx/stopScript When searching for pattern startScript, the 1st line shoul...

Printing lines from a file where a specific field does not start with something..

Hi, I want to print all the lines where 3rd field (fields separated by : ) DO NOT start with # (to signify that 3rd field is a comment). Please note that there may be space(s) between : and #. Example Input: A:B:#hdfghdfg A:B: #dfdfdfg A:B:C Desired output: A:B:C I tried: awk -F : '$3 ~ /^#/ { print }' run_out5 > run_out6 b...

How to detect using of wildcard (asterisk *) as parameter for shell script?

In my script, how can I distinguish when the asterisk wildcard character was used instead of strongly typed parameters? This # myscript * from this # myscript p1 p2 p3 ... (where parameters are unknown number) ...

Solaris 10: handle gracefully ENOBUFS error when changing socket buffer

I have stumbled on a peculiar difference between Solaris 10 sockets and other Linux/*NIX sockets. Example: int temp1, rc; temp1 = 16*1024*1024; /* from config, a value greater than system limit */ rc = setsockopt( sd, SOL_SOCKET, SO_RCVBUF, &temp1, sizeof(temp1); The code above will have rc == 0 on all systems - Linux, HP-UX and AIX ...

What can cause exec to fail? What happens next?

What are the reasons that an exec (execl,execlp, etc.) can fail? If you make a call to exec and it returns, are there any best practices other than just panicking and calling exit? ...

zip archive from a directory tree but only include files with extensions xx1,xx2,...?

What's a combination of commands on MacOS that'll start at the root of some directory tree and create a zip file archive of it, preserving directory structure, but only including files with extensions "ext1" and "ext2"? ...

Sending structs through Unix domain sockets

I am using Unix domain sockets to do some interprocess communication in Linux. Upon connection, the client sends a struct using send to the server. This struct contains some information about the client including an identifier string at the end. The server receives the info just find and sends another struct back. The client blocks with ...

Conversion between binary and decimal

How do I convert between decimal and binary? I'm working on a Solaris 10 platform Decimal to Binary 4000000002 -> 100000000000000000000000000010 Binary to Decimal 100000000000000000000000000010 -> 4000000002 I used the following command in unix but it takes lot of time. I have 2 crore records like this For decimal to ...

How to prevent a Linux program from running more than once?

What is the best way to prevent a Linux program/daemon from being executed more than once at a given time? ...

How to use the pidfile library correctly?

I already read the man page of the pidfile function family. But I don't really understand it. What is the correct usage? Is there a more elaborate example available? I think I understand pidfile_open. But when should I call pidfile_write and prdfile_close? From which process? Parent or child? What parameters do I have to pass to those fu...

Weird bug with interupted system call, that I can't debug

I'm working on a batch system (Torque), now the important part is this: When an interactive job is run, the submit tool will communicate with the execution host. This fails on one of the machines. Here is the strace output: Sumbit tool: 16:18:36.219925 fcntl(4, F_GETFL) = 0x2 (flags O_RDWR) ...

Copying files across computers using SSH and MAC OS X Terminal

Im trying to copy my .profile, .rvm and .ssh folders/files to a new computer and I know how to use the cp and ssh commands but I'm not sure how to use them in order to transfer files from one computer to another. Any help would be great, thanks! ...

SVN GUI frontends for managing projects and users?

Hi all, Our hackerspace (091labs.com) is getting a few software projects started at the moment, and we're using Trac and SVN for bug tracking/source control. However, every time I set up a new projects I've to go through the whole speil in the command line of creating the Trac project, creating the SVN repository, configuring auth, edi...

Unix write() function (libc)

Hello, I am making a C application in Unix that uses raw tty input. I am calling write() to characters on the display, but I want to manipulate the cursor: ssize_t write(int d, const void *buf, size_t nbytes); I've noticed that if buf has the value 8 (I mean char tmp = 8, then passing &tmp), it will move the cursor/pointer backward ...