unix

Unix: How to use Bash backticks recursively

Either I missed some backlash or backlashing does not seem to work with too much programmer-quote-looping. $ echo "hello1-`echo hello2-\`echo hello3-\`echo hello4\`\``" hello1-hello2-hello3-echo hello4 Wanted hello1-hello2-hello3-hello4-hello5-hello6-... ...

What are some tips for troubleshooting builds of complicated software?

Sometimes I want to build Python or GCC from scratch just for fun, but I can't parse the errors I get, or don't understand statements like "libtool link error # XYZ". What are some tricks that unix/systems gurus use to compile software of this size from scratch? Of course I already do things like read config.log (if there is one), googl...

How can I send an std::vector<std::string> over a UNIX socket?

For my application, I need to be able to send an std::vector<std::string> over a UNIX socket(local), and get a copy of the vector on the other end of the socket. What's the easiest way to do this with O(1) messages relative to the size of the vector(i.e. without sending a message for each string in the vector)? Since this is all on the ...

Key stroke time in Openmoko or any smart phones

Dear all, I am doing a project in which I am working on security issues related to smart phones. I want to develop an authentication scheme which is based on biometrics, Every human being have a unique key-hold time,digraph time error rate. Key-Hold Time : Time difference between pressing and releasing a key Digraph Time : Time differ...

C socket programming: client send() but server select() doesn't see it

Hey all, I have a server and a client running on two different machines where the client send()s but the server doesn't seem to receive the message. The server employs select() to monitor sockets for any incoming connections/messages. I can see that when the server accepts a new connection, it updates the fd_set array but always returns ...

Unix: how to have delimiter as "\t&\t" in paste-tool?

Results are in clean files. I want to get them to latex-table format with paste. So how can I have a delimiter "\t&\t"? or is there some Latex tool? Pasting Columnwise to have \t&\t delimiter $ paste -d'\t\&\t' d d_powered_-2 rad 5.0 400.0&384.5 7.5 204.1&184.5 10.0 100.0&115.5 15.0 44.4&58.2 20.0 25.0&45.0 25....

Extract File Basename Without Path and Extension in Bash

Given file names like these: /the/path/foo.txt bar.txt I hope to get foo bar Why this doesn't work? #!/bin/bash fullfile=$1 fname=$(basename $fullfile) fbname=${filename%.*} echo $fbname What's the right way to do it? ...

What does it mean "regular file" according to S_ISREG C/C++ ?

Hello all, Let's consider the following 3 code lines: struct stat buffer; status = lstat(file.c_str(), &buffer); bool Flag = S_ISREG(buffer.st_mode) When S_ISREG() returns true it tells you that the file is a regular file What does regular means exactly ? Thanks ...

Understanding EXE Internals

I was attempting to install an exe that requires a serial number before the install, which the vendor has not provided to us yet. This got my wheels turning about whether there is any information that can be gained from viewing an exe using a hex editor/VI/etc? Using VI to view an exe, I can see some sections of plain text, but it is...

What are the minimum unix permissions to run an executable jar file?

If I have a jar that I need to run using java -jar FOO.jar on unix, does this depend on the read, write or execute bit? Or some combination thereof? ...

Fixing permissions after FTPing ASP.NET code to a Linux system

First off, I'm running Mono to run ASP.NET on Linux, but that's not the question. It appears that, every time I clear out my application directory and upload, I have to go back in and fix the permissions. What I'm doing is chmod -R -c 755 /var/www/* ...and there are two questions. What's the deal with having to do this every time...

Is there a way to load a profile inside Perl?

Is there a way to load a profile inside Perl? Like in shell files: . ~user/.profile ...

C socket programming: calling recv() changes my socket file descriptor?

Hey all, I have this strange problem with recv(). I'm programming client/server where client send() a message (a structure to be exact) and server recv() it. I am also working with multiple sockets and select(). while(1) { readset = info->read_set; info->copy_set = info->read_set; timeout.tv_sec = 1; timeout.tv_usec =...

limits of number of files in a single directory in unix/linux using Python

is it bad to output many files to the same directory in unix/linux? I run thousands of jobs on a cluster and each outputs a file, to one directory. The upper bound here is around ~50,000 files. Can IO be limited in speed in light of this? If so, does the problem go away with a nested directory structure? Thanks. ...

Where can I obtain a list of UNIX system calls?

Where are some lists of system calls on UNIX? This wasn't my original question, but thanks anyway :) ...

Type of Linux/Unix I/O

hi guys, i have to make a presentation about Linux/Unix I/O: File I/O,Standard I/O, buffered/unbuffered I/O and formatted/unformatted I/O. i'm not sure how to order these kinds of I/O to make sense. here is my try: file I/O unbuffered I/O buffered I/O Standard I/O formatted/unformatted I/O is this correct ?? thx anyway ...

why is the line #!/bin/ksh is the first line in a shell script

#!/bin/ksh is the first line in a shell script always what is the importance of this line and why is it kept as the first line. ...

How to increase the number of characters in a putty session

Hi, I am using Putty to execute some command. The command length that I have is having 323 characters. But its allowing me to type only 256 characters. Please help me. How to increase that limit. Thanks ...

scripting in awk

I have a text file with contents as below: 1,A,100 2,A,200 3,B,150 4,B,100 5,B,250 i need the output as : A,300 B,500 the logic here is sum of all the 3rd fields whose 2nd field is A and in the same way for B how could we do it using awk? ...

Replace text from a MySQL dump using cat (or something else) in shell

I've got a database dump in MySQL where I want to replace ocurrencies of paths that are in the dump as plaintext. In this particular case I'd like to replace: /var/www/ for /home/www/ How could I safely do that using cat or any other shell tool? ...