unix

Can the data in a UDP packet be assumed to be correct at the application level?

I recall reading somewhere that if a udp actually gets to the application layer that the data can assume to be intact. Disregarding the possibility of someone in the middle sending fake packets will the data I receive in the application layer always be what was sent out? ...

CS senior project ideas involving Unix system programming

I know there are a number of questions about senior project ideas but I am specifically looking for a project that involves Unix system programming in C or (preferably) C++. I have the book which I used for one quarter but haven't had a chance to use since. I want to find a project that will give me as much experience with Unix system ...

Monitor the data in a table

How to write a shell script/process which runs like a daemon on Unix and continuously monitors a field in the table and sleeps for 30 sec's. The field value will regularly increase to a maximum value and my process/script which is monitoring will provide a simple select query output to a log file. any approach is preferred. ...

What is the output of this program?

Hi, when i tried to run compile and execute this statement in a simple c file: main(){ printf("%d");} on HP it's is giving me 64 and on AIX its giving me 804359524. Could anyone tell me what is this behavior. ...

Automated download script

I'd like to run a script that reads a list of URL's from a file and downloads each URL one at a time. The script reads one line from my url list and invokes the command aria2c -D & completes 1st URL then goes to 2nd URL and so on till the end of the list. Help Thanks in advance ...

Is there a standard way to diff du outputs to detect where disk space usage has grown the most

I work with a small team of developers where we share a unix file system to store somewhat large datasets. This file system has a somewhat prohibitive quota on it so about once a month we have to figure out where our free space has gone and see what we can recover. Obviously we use du a fair amount but this is still a tedious process. ...

Monitor folder for new files using unix ksh shell script or perl script and trigger perl script

I've been Googling and Overflowing for a bit and couldn't find anything usable. I need a script that monitors a public folder and triggers on new file creation and then moves the files to a private location. I have a samba shared folder /exam/ple/ on unix mapped to X:\ on windows. On certain actions, txt files are written to the share...

is there a way to parse or read the directory as a file?

This might be sort of trivial question but in any case, i was wondering if there is a way to read a directory as a file which one will be using open(), close(), read() instead of opendir(), closedir(), readdir()... I might be wrong, however, i'm thinking that this can speed-up directory traversing. Thanks ...

Printing out names of only directories and not files (BASH)

I have most of what I need so far I'm just unsure of the grep command to get only directories or if there isn't one. For context, this is the original request: This script should take a single command line argument which will be a path to a directory. (done) The script should make sure that the path is, in fact, a directory and that th...

SQL*Loader problem

I am getting an error SQL*Loader-606, which means: The synonym specified in the INTO TABLE clause in the SQL*Loader control file specifies a remote object via a database link. Only a synonym for an existing local table can be specified in the INTO TABLE clause. Is there any way we can insert into remote table using SQL*Lo...

Replacements for gettext

We use gettext for translations in our product, but have had a lot of problems with it: Can't use a language unless the system supports it. On Solaris 9 Sparc, if we reset the environment to various English locales, the message still won't be translated, if the machine doesn't have the corresponding locale. The translation file is pr...

Uppercasing First Letter of Words Using SED

How do you replace the first letter of a word into Capital letter, e.g. Trouble me Gold rush brides into Trouble Me Gold Rush Brides ...

Check date of a file in unix

In my unix shell script, I have a for loop and looping thru the files in a directory, I want to check the modified date of a file is greater than some number of days, say 10 days and do some processing. Any help in this regards is highly appreciated. ...

C code - need to clarify the effectiveness.

Hi I have written a code based upon a requirement. (field1_6)*(field2_30)*(field3_16)*(field4_16)*(field5_1)*(field6_6)*(field7_2)*(field8_1)*..... this is one bucket(8 fields) of data. we will receive 20 buckets at a time means totally 160 fields. i need to take the values of field3,field7 & fields8 based upon predefined condition. i...

Which UNIX tool should I use to handle a substitution list?

Suppose I have one file A which is a list with a two-digit key numbers and three-digit subject numbers. Now suppose I have a second file B containing a list of pairs of subject numbers. I want to substitute in key numbers for pair numbers in file B. My question is, what is the right UNIX tool for this substitution list job? Can it be el...

Converting FASTQ to FASTA with SED/AWK

I have a data in that always comes in block of four in the following format (called FASTQ): @SRR018006.2016 GA2:6:1:20:650 length=36 NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNGN +SRR018006.2016 GA2:6:1:20:650 length=36 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!+! @SRR018006.19405469 GA2:6:100:1793:611 length=36 ACCCGCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC +SRR...

unix network process

Hi, I was wondering how tcp/ip communication is implemented in unix. When you do a send over the socket, does the tcp/level work (assembling packets, crc, etc) get executed in the same execution context as the calling code? Or, what seems more likely, a message is sent to some other daemon process responsible for tcp communication? Th...

How to compare two files in shell script?

Here is my scenario. I have two files which are having records with each record's 3-25 characters is an identifier. Based on this I need to compare both of them and update the old file with the new file data if their identifiers match. Identifiers start with 01. Please look at the script below. This is giving some error as "argument expe...

How to Replace a line in the same file by SED in Unix Shell scripting?

Hi In Reference to this question After getting the line identifier matching in first and second file I need to replace the line in first file with the line of second file.For that I am using SED as below. But Sed only replaces that line in a new file. How can I achieve the updation in same file without temporary file.(Because those are v...

Script for changing the sequence number on a file name

I am writing a shell script and I am stuck. The requirement is: I will receive files which have a sequence number on them like xyz0001abcd.DAT. I create a copy of that file, keeping the sequence number, as abcd000001gfh.DAT. The original filename uses four digits (up to 9999), and the copied one uses six (up to 999999). I am stuck when...