01-31-2011
Look into the ksh trimmers like ${#} and ${%%}, since "${file%_*}.extn" is like your sed. My memory mnemonic is pound # on the nose, get your % in the end. Double is aggressive wc, single is lazy wildcard. Saves fork, exec per.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I have a file containing 750,000 records and have managed to sort them by related columns and now i'd like to add an ID number to the front of each line of the records that are grouped together. Which probably makes no sense so i have provided some example data and desired result.
Given data.txt... (2 Replies)
Discussion started by: RacerX
2 Replies
2. Shell Programming and Scripting
Hi,
I'm, new to shell scripting, I have a requirement where I have to split an incoming file into separate files each containing a maximum of 3 million rows.
For e.g: if my incoming file say In.txt has 8 mn rows then I need to create 3 files, in which two will 3 mn rows and one will contain 2... (2 Replies)
Discussion started by: wahi80
2 Replies
3. UNIX for Advanced & Expert Users
Hi,
We have some clients who will place huge files in to one of the remote server.
And the shell script written in our local server to retrieve client files (using FTP) placed on one of the remote server of ours by clients.
My question Is there any FTP command/script to check from my local... (1 Reply)
Discussion started by: nmsrao
1 Replies
4. Shell Programming and Scripting
I have a file with the following format, i need to change de field9 each 3 rows to renumber field9 with gpo1, gpo2, gpo3.
I need to use awk
Original file
field1 field2 field3 field4 field5 field6 field7 field8 gpo3
field1 field2 field3 field4 field5 ... (3 Replies)
Discussion started by: robonet
3 Replies
5. UNIX for Dummies Questions & Answers
I have a text file with 1,000,000 rows (It is a single column text file of numbers). I would like to separate the text file into 100 files of equal size (i.e. number of rows). The first file will contain the first 10,000 rows, the second row will contain the second 10,000 rows (rows 10,001-20,000)... (2 Replies)
Discussion started by: evelibertine
2 Replies
6. UNIX for Dummies Questions & Answers
Hi,
I have two files that I would like to merge and think that there should be a solution using awk. The files look something like this:
file 1
IDX1 IDY1
IDX2 IDY2
IDX3 IDY3
file 2
IDY1 dataA data1
IDY2 dataB data2
IDY3 dataC data3
Desired output
IDX1 IDY1 dataA data1
IDX2 ... (5 Replies)
Discussion started by: katie8856
5 Replies
7. UNIX for Dummies Questions & Answers
Hello Friends,
I know you all are busy and inteligent too...
I am stuck with one small issue if you can help me then it will be really great.
My problem is I am having some files i.e.
Input.txt1
Input.txt2
Input.txt3
Now my task is I need to check the total number of rows in... (4 Replies)
Discussion started by: malaya kumar
4 Replies
8. Shell Programming and Scripting
Hi,
i want to execute a shell script which transfers files from one server to another using ftp in unix. How can i check whether the ftp is successful or not.(i.e files are transferred to destination server). because if i am checking the return code of ftp, it always shows 0 (denoting ftp is... (5 Replies)
Discussion started by: Little
5 Replies
9. Shell Programming and Scripting
Hi
I have a requirement, where i will receive multiple files in a folder (say: /fol1/fol2/). There will be at least 14 to 16 files. The size of the files will different, some may be 80GB or 90GB, some may be less than 5 GB (and the size of the files are very unpredictable). But the names of the... (10 Replies)
Discussion started by: kpk_ds
10 Replies
10. UNIX for Beginners Questions & Answers
how to check if any files are being FTP'ed currently ? both FTP in and FTP out. And is there any system log for all the FTP activities ? (2 Replies)
Discussion started by: i4ismail
2 Replies
LEARN ABOUT DEBIAN
ibv_fork_init
IBV_FORK_INIT(3) Libibverbs Programmer's Manual IBV_FORK_INIT(3)
NAME
ibv_fork_init - initialize libibverbs to support fork()
SYNOPSIS
#include <infiniband/verbs.h>
int ibv_fork_init(void);
DESCRIPTION
ibv_fork_init() initializes libibverbs's data structures to handle fork() function calls correctly and avoid data corruption, whether
fork() is called explicitly or implicitly (such as in system()).
It is not necessary to use this function if all parent process threads are always blocked until all child processes end or change address
spaces via an exec() operation.
RETURN VALUE
ibv_fork_init() returns 0 on success, or the value of errno on failure (which indicates the failure reason).
NOTES
ibv_fork_init() works on Linux kernels supporting the MADV_DONTFORK flag for madvise() (2.6.17 and higher).
Setting the environment variable RDMAV_FORK_SAFE or IBV_FORK_SAFE has the same effect as calling ibv_fork_init().
Setting the environment variable RDMAV_HUGEPAGES_SAFE tells the library to check the underlying page size used by the kernel for memory
regions. This is required if an application uses huge pages either directly or indirectly via a library such as libhugetlbfs.
Calling ibv_fork_init() will reduce performance due to an extra system call for every memory registration, and the additional memory allo-
cated to track memory regions. The precise performance impact depends on the workload and usually will not be significant.
Setting RDMAV_HUGEPAGES_SAFE adds further overhead to all memory registrations.
SEE ALSO
fork(2), wait(2), system(3), exec(3), ibv_get_device_list(3)
AUTHORS
Dotan Barak <dotanba@gmail.com>
libibverbs 2006-10-31 IBV_FORK_INIT(3)