05-14-2008
cat filenames.txt | xargs grep pattern
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi
I have a csv file as follows
608, Barnwood PFS,,2
150, Barnwood CS,2,4
etc
When i do for lines in `cat file.dat` the space in second argument seems to screwing the lines up.
Any suggestions to get around this?
Thanks (5 Replies)
Discussion started by: handak9
5 Replies
2. UNIX for Dummies Questions & Answers
Hi ,
I am new to shell scripting (ksh shell) and trying to accomplish few requiremtns.
I have a file with the following format
EMP NO EMP NAME AGE Amt Paid
12 Mark Taylor 32 32333
14 James Brown... (5 Replies)
Discussion started by: royalsing
5 Replies
3. Shell Programming and Scripting
Hello
I'm stuck trying to solve this KSH issue and I'm hoping someone out there can offer some suggestions.
I want to read lots of large .gz files one line at a time in order to compare its Error entries with a list of known errors. I can't simply do "foreach ERROR do gzcat *.gz |grep... (2 Replies)
Discussion started by: dayscripter
2 Replies
4. Shell Programming and Scripting
Hi,
i have file which contains data as below(Only sample shown, it may contain more data similar to the one shown here)
i need to read this file line by line and generate an output file like the one below
i.e based on N value the number of MSISDNs will vary, if N=1 then the following... (14 Replies)
Discussion started by: aemunathan
14 Replies
5. Shell Programming and Scripting
Hi ,
I am trying to write an shell, which reads a text file (from a location) having a list of numbers of strictly 5 digits only ex: 33144
Now my script will check :
1) that each entry is only 5 digits & numeric only, no alphabets, & its not empty.
2)then it executes a shell script called... (8 Replies)
Discussion started by: new_to_shell
8 Replies
6. Shell Programming and Scripting
Greetings, I'm new to this forum, also new to shell script
I have done some simple shell script before, like backup linux machine using rsync and crontab, but now I need to do some log analyzing, which is beyond my ability... so I'm going to seek for help in this forum, hope someone could give... (5 Replies)
Discussion started by: lunaticdawn
5 Replies
7. Shell Programming and Scripting
Hi, there
I have a file with tab and space as field separator. I need to assign values to variables then work with them, line by line. The code I wrote only works when each line has only one word. It doesn't work for the current situation.
for line in `cat file.txt`; do
ID=`awk '{print... (4 Replies)
Discussion started by: cwzkevin
4 Replies
8. Shell Programming and Scripting
Hi,
I want to read a live log file line by line and considering those line which are newly added to file
Below code I am using, which read line but as soon as it read new line from log file its starts processing from very first line of file.
tail -F /logs/COMMON-ERROR.log | while read... (11 Replies)
Discussion started by: ketanraut
11 Replies
9. Shell Programming and Scripting
Hi All,
Am trying to write wrapper shell/bash script on a utility tool for which i need to pass 2 files as arugment to execute utility tool.
Wraper script am trying is to do with above metion 2 files.
utility tool accepts :
a. userinfo file : which contains username
b. item file : which... (2 Replies)
Discussion started by: Optimus81
2 Replies
10. Shell Programming and Scripting
Hi,
I have a file with contents
So what I have to do is
In short, break the file after every 6 lines and then truncate new line to tab for these 6 lines.
I am not able to execute the for loop in awk properly.
The idea is something like this:
less file| awk '{for .... {if ((nr>=1)... (7 Replies)
Discussion started by: rossi
7 Replies
LEARN ABOUT OPENSOLARIS
mlib_imagedivalpha
mlib_ImageDivAlpha(3MLIB) mediaLib Library Functions mlib_ImageDivAlpha(3MLIB)
NAME
mlib_ImageDivAlpha - alpha channel division
SYNOPSIS
cc [ flag... ] file... -lmlib [ library... ]
#include <mlib.h>
mlib_status mlib_ImageDivAlpha(mlib_image *dst, const mlib_image *src,
mlib_s32 cmask);
DESCRIPTION
The mlib_ImageDivAlpha() function divides color channels by the alpha channel on a pixel-by-pixel basis.
For the MLIB_BYTE image, it uses the following equation:
dst[x][y][c] = src[x][y][c] / (src[x][y][a] * 2**(-8))
For the MLIB_SHORT image, it uses the following equation:
dst[x][y][c] = src[x][y][c] / (src[x][y][a] * 2**(-15))
For the MLIB_USHORT image, it uses the following equation:
dst[x][y][c] = src[x][y][c] / (src[x][y][a] * 2**(-16))
For the MLIB_INT image, it uses the following equation:
dst[x][y][c] = src[x][y][c] / (src[x][y][a] * 2**(-31))
where c and a are the indices for the color channels and the alpha channel, respectively, so c != a.
In the case of src[x][y][a] = 0,
dst[x][y][c] = 0 if src[x][y][c] = 0
dst[x][y][c] = DATA_TYPE_MAX if src[x][y][c] > 0
dst[x][y][c] = DATA_TYPE_MIN if src[x][y][c] < 0
where DATA_TYPE is MLIB_U8, MLIB_S16, MLIB_U16, or MLIB_S32 for an image of type MLIB_BYTE, MLIB_SHORT, MLIB_USHORT, or MLIB_INT, respec-
tively.
PARAMETERS
The function takes the following arguments:
dst Pointer to destination image.
src Pointer to source image.
cmask Channel mask to indicate the alpha channel. Each bit of the mask represents a channel in the image. The channel corresponding to
the 1 bit of cmask is the alpha channel.
RETURN VALUES
The function returns MLIB_SUCCESS if successful. Otherwise it returns MLIB_FAILURE.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Committed |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
SEE ALSO
mlib_ImageDivAlpha_Inp(3MLIB), mlib_ImageDivAlpha_Fp(3MLIB), mlib_ImageDivAlpha_Fp_Inp(3MLIB), attributes(5)
SunOS 5.11 2 Mar 2007 mlib_ImageDivAlpha(3MLIB)