Sponsored Content
Top Forums Shell Programming and Scripting regexp to get first line of string Post 302116773 by aigles on Tuesday 8th of May 2007 12:24:07 PM
Old 05-08-2007
You can try :
Code:
echo ""$file: `echo "$output" | sed -n 1p`"


Jean-Pierre.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

RegExp: From first occurrance to last (at line start)

So I have a log that contains something like this: What I want is to get the first occurrence of "^localhost0" (at line start) and then everything else up to the last occurrence of "^localhost0" (at line start) Ideally I don't even care about the 2 "localhost0" lines either. All I really... (6 Replies)
Discussion started by: jjinno
6 Replies

2. UNIX for Dummies Questions & Answers

print the line immediately after a regexp; but regexp is a sentence

Good Day, Im new to scripting especially awk and sed. I just would like to ask help from you guys about a sed command that prints the line immediately after a regexp, but not the line containing the regexp. sed -n '/regexp/{n;p;}' filename What if my regexp is 3 word or a sentence. Im... (3 Replies)
Discussion started by: ownins
3 Replies

3. Shell Programming and Scripting

use regexp to insert newline within a line

I have successfully used regexp and sed to insert a newline before or after a line containing a matched pattern /WORD/. However, I want to insert a newline immediately following /WORD/ and not after the -line- containing the pattern matched. I can match a pattern, but it is matched via a wild card... (2 Replies)
Discussion started by: kpeirce
2 Replies

4. Shell Programming and Scripting

...yet another string of awk/sed questions from a RegExp-Challenged luser %-\

Greetings all, ...here is yet another string of awk/sed questions from a RegExp-Challenged luser :eek: I'm looking to have sed/awk do some clean-up on routing tables and to that end, I would like to do the following: 1.) If a line contains the word "masks" or "subnets" prepend CR/LF to... (16 Replies)
Discussion started by: SteveB-in-LV
16 Replies

5. Shell Programming and Scripting

extract string until regexp from backside

Hi, I searched in the forums, but I didn't find a good solution. My problem is: I have a string like "TEST.ABC201005.MONTHLY.D101010203". I just want to have the string until the D100430, so that the string should look like: "TEST.ABC201005.MONTHLY.D" The last characters after the D can be... (8 Replies)
Discussion started by: elifchen
8 Replies

6. UNIX for Dummies Questions & Answers

regexp: match string that contains list of chars

Hi, I'm curious about how to do a very simple thing with regular expressions that I'm unable to figure out. If I want to find out if a string contains 'a' AND 'b' AND 'c' it can be very easily done with grep: echo $STRING|grep a|grep b|grep c but, how would you do that in a single... (9 Replies)
Discussion started by: jimcanoa
9 Replies

7. Shell Programming and Scripting

How to use regexp to find an ipaddress from a query string?

I need help with a regexp to find out the ip address which can possibly be present in a URL. The URLs can be in any of the following form <domain>?a=12345&d=somestring1 <domain>?c=10.10.10.100&d=somestring1 <domain>?a=12345&b=somestring1&c=10.1.2.4d=somestring2... (3 Replies)
Discussion started by: ampak
3 Replies

8. Shell Programming and Scripting

Regexp for string that might contain a given character

I'm probably just not thinking of the correct term to search for :-) But I want to match a pattern that might be 'ABC' or '1ABC' there might be three characters, or there might be four, but if there are four, the first has to be 1 (1 Reply)
Discussion started by: jnojr
1 Replies

9. Shell Programming and Scripting

Print 4th line back from regexp

I'm looking for a way to print the 4th line back from a regular expression. Kind of like the below but it has to be the 4th line before the regexp. Print the line immediately before regexp, but not the line containing the regexp. sed -n '/regexp/{g;1!p;};h' here is an example of logs(i... (11 Replies)
Discussion started by: senormarquez
11 Replies

10. Shell Programming and Scripting

find and Replace String in Perl - Regexp

Trying to find and replace one string with another string in a file #!/usr/bin/perl $csd_table_path = "/file.ntab"; $find_str = '--bundle_type=021'; $repl_str = '--bundle_type=021 --target=/dev/disk1s2'; if( system("/usr/bin/perl -p -i -e 's/$find_str/$repl_str/' $csd_table_path")... (2 Replies)
Discussion started by: cillmor
2 Replies
pods::SDL::GFX::ImageFilter(3pm)			User Contributed Perl Documentation			  pods::SDL::GFX::ImageFilter(3pm)

NAME
SDL::GFX::ImageFilter - image filtering functions CATEGORY
TODO, GFX METHODS
MMX_detect int gfx_image_MMX_detect() CODE: SDL_imageFilterMMXdetect(); MMX_off void gfx_image_MMX_off() CODE: SDL_imageFilterMMXoff(); MMX_on void gfx_image_MMX_on() CODE: SDL_imageFilterMMXon(); add int gfx_image_add(Src1, Src2, Dest, length) unsigned char *Src1 unsigned char *Src2 unsigned char *Dest int length CODE: RETVAL = SDL_imageFilterAdd(Src1, Src2, Dest, length); OUTPUT: RETVAL mean int gfx_image_mean(Src1, Src2, Dest, length) unsigned char *Src1 unsigned char *Src2 unsigned char *Dest int length CODE: RETVAL = SDL_imageFilterMean(Src1, Src2, Dest, length); OUTPUT: RETVAL sub int gfx_image_sub(Src1, Src2, Dest, length) unsigned char *Src1 unsigned char *Src2 unsigned char *Dest int length CODE: RETVAL = SDL_imageFilterSub(Src1, Src2, Dest, length); OUTPUT: RETVAL abs_diff int gfx_image_abs_diff(Src1, Src2, Dest, length) unsigned char *Src1 unsigned char *Src2 unsigned char *Dest int length CODE: RETVAL = SDL_imageFilterAbsDiff(Src1, Src2, Dest, length); OUTPUT: RETVAL mult int gfx_image_mult(Src1, Src2, Dest, length) unsigned char *Src1 unsigned char *Src2 unsigned char *Dest int length CODE: RETVAL = SDL_imageFilterMult(Src1, Src2, Dest, length); OUTPUT: RETVAL mult_nor int gfx_image_mult_nor(Src1, Src2, Dest, length) unsigned char *Src1 unsigned char *Src2 unsigned char *Dest int length CODE: RETVAL = SDL_imageFilterMultNor(Src1, Src2, Dest, length); OUTPUT: RETVAL mult_div_by_2 int gfx_image_mult_div_by_2(Src1, Src2, Dest, length) unsigned char *Src1 unsigned char *Src2 unsigned char *Dest int length CODE: RETVAL = SDL_imageFilterMultDivby2(Src1, Src2, Dest, length); OUTPUT: RETVAL mult_div_by_4 int gfx_image_mult_div_by_4(Src1, Src2, Dest, length) unsigned char *Src1 unsigned char *Src2 unsigned char *Dest int length CODE: RETVAL = SDL_imageFilterMultDivby4(Src1, Src2, Dest, length); OUTPUT: RETVAL bit_and int gfx_image_bit_and(Src1, Src2, Dest, length) unsigned char *Src1 unsigned char *Src2 unsigned char *Dest int length CODE: RETVAL = SDL_imageFilterBitAnd(Src1, Src2, Dest, length); OUTPUT: RETVAL bit_or int gfx_image_bit_or(Src1, Src2, Dest, length) unsigned char *Src1 unsigned char *Src2 unsigned char *Dest int length CODE: RETVAL = SDL_imageFilterBitOr(Src1, Src2, Dest, length); OUTPUT: RETVAL div int gfx_image_div(Src1, Src2, Dest, length) unsigned char *Src1 unsigned char *Src2 unsigned char *Dest int length CODE: RETVAL = SDL_imageFilterDiv(Src1, Src2, Dest, length); OUTPUT: RETVAL bit_negation int gfx_image_bit_negation(Src1, Dest, length) unsigned char *Src1 unsigned char *Dest int length CODE: RETVAL = SDL_imageFilterBitNegation(Src1, Dest, length); OUTPUT: RETVAL add_byte int gfx_image_add_byte(Src1, Dest, length, C) unsigned char *Src1 unsigned char *Dest int length unsigned char C CODE: RETVAL = SDL_imageFilterAddByte(Src1, Dest, length, C); OUTPUT: RETVAL add_uint int gfx_image_add_uint(Src1, Dest, length, C) unsigned char *Src1 unsigned char *Dest int length unsigned int C CODE: RETVAL = SDL_imageFilterAddUint(Src1, Dest, length, C); OUTPUT: RETVAL add_byte_to_half int gfx_image_add_byte_to_half(Src1, Dest, length, C) unsigned char *Src1 unsigned char *Dest int length unsigned char C CODE: RETVAL = SDL_imageFilterAddByteToHalf(Src1, Dest, length, C); OUTPUT: RETVAL sub_byte int gfx_image_sub_byte(Src1, Dest, length, C) unsigned char *Src1 unsigned char *Dest int length unsigned char C CODE: RETVAL = SDL_imageFilterSubByte(Src1, Dest, length, C); OUTPUT: RETVAL sub_uint int gfx_image_sub_uint(Src1, Dest, length, C) unsigned char *Src1 unsigned char *Dest int length unsigned int C CODE: RETVAL = SDL_imageFilterSubUint(Src1, Dest, length, C); OUTPUT: RETVAL shift_right int gfx_image_shift_right(Src1, Dest, length, N) unsigned char *Src1 unsigned char *Dest int length unsigned char N CODE: RETVAL = SDL_imageFilterShiftRight(Src1, Dest, length, N); OUTPUT: RETVAL shift_right_uint int gfx_image_shift_right_uint(Src1, Dest, length, N) unsigned char *Src1 unsigned char *Dest int length unsigned char N CODE: RETVAL = SDL_imageFilterShiftRightUint(Src1, Dest, length, N); OUTPUT: RETVAL mult_by_byte int gfx_image_mult_by_byte(Src1, Dest, length, C) unsigned char *Src1 unsigned char *Dest int length unsigned char C CODE: RETVAL = SDL_imageFilterMultByByte(Src1, Dest, length, C); OUTPUT: RETVAL shift_right_and_mult_by_byte int gfx_image_shift_right_and_mult_by_byte(Src1, Dest, length, N, C) unsigned char *Src1 unsigned char *Dest int length unsigned char N unsigned char C CODE: RETVAL = SDL_imageFilterShiftRightAndMultByByte(Src1, Dest, length, N, C); OUTPUT: RETVAL shift_left_byte int gfx_image_shift_left_byte(Src1, Dest, length, N) unsigned char *Src1 unsigned char *Dest int length unsigned char N CODE: RETVAL = SDL_imageFilterShiftLeftByte(Src1, Dest, length, N); OUTPUT: RETVAL shift_left_uint int gfx_image_shift_left_uint(Src1, Dest, length, N) unsigned char *Src1 unsigned char *Dest int length unsigned char N CODE: RETVAL = SDL_imageFilterShiftLeftUint(Src1, Dest, length, N); OUTPUT: RETVAL shift_left int gfx_image_shift_left(Src1, Dest, length, N) unsigned char *Src1 unsigned char *Dest int length unsigned char N CODE: RETVAL = SDL_imageFilterShiftLeft(Src1, Dest, length, N); OUTPUT: RETVAL binarize_using_threshold int gfx_image_binarize_using_threshold(Src1, Dest, length, T) unsigned char *Src1 unsigned char *Dest int length unsigned char T CODE: RETVAL = SDL_imageFilterBinarizeUsingThreshold(Src1, Dest, length, T); OUTPUT: RETVAL clip_to_range int gfx_image_clip_to_range(Src1, Dest, length, Tmin, Tmax) unsigned char *Src1 unsigned char *Dest int length unsigned char Tmin unsigned char Tmax CODE: RETVAL = SDL_imageFilterClipToRange(Src1, Dest, length, Tmin, Tmax); OUTPUT: RETVAL normalize_linear int gfx_image_normalize_linear(Src1, Dest, length, Cmin, Cmax, Nmin, Nmax) unsigned char *Src1 unsigned char *Dest int length int Cmin int Cmax int Nmin int Nmax CODE: RETVAL = SDL_imageFilterNormalizeLinear(Src1, Dest, length, Cmin, Cmax, Nmin, Nmax); OUTPUT: RETVAL convolve_kernel_3x3_divide int gfx_image_convolve_kernel_3x3_divide(Src, Dest, rows, columns, Kernel, Divisor) unsigned char *Src unsigned char *Dest int rows int columns Sint16 *Kernel unsigned char Divisor CODE: RETVAL = SDL_imageFilterConvolveKernel3x3Divide(Src, Dest, rows, columns, Kernel, Divisor); OUTPUT: RETVAL convolve_kernel_5x5_divide int gfx_image_convolve_kernel_5x5_divide(Src, Dest, rows, columns, Kernel, Divisor) unsigned char *Src unsigned char *Dest int rows int columns Sint16 *Kernel unsigned char Divisor CODE: RETVAL = SDL_imageFilterConvolveKernel5x5Divide(Src, Dest, rows, columns, Kernel, Divisor); OUTPUT: RETVAL convolve_kernel_7x7_divide int gfx_image_convolve_kernel_7x7_divide(Src, Dest, rows, columns, Kernel, Divisor) unsigned char *Src unsigned char *Dest int rows int columns Sint16 *Kernel unsigned char Divisor CODE: RETVAL = SDL_imageFilterConvolveKernel7x7Divide(Src, Dest, rows, columns, Kernel, Divisor); OUTPUT: RETVAL convolve_kernel_9x9_divide int gfx_image_convolve_kernel_9x9_divide(Src, Dest, rows, columns, Kernel, Divisor) unsigned char *Src unsigned char *Dest int rows int columns Sint16 *Kernel unsigned char Divisor CODE: RETVAL = SDL_imageFilterConvolveKernel9x9Divide(Src, Dest, rows, columns, Kernel, Divisor); OUTPUT: RETVAL convolve_kernel_3x3_shift_right int gfx_image_convolve_kernel_3x3_shift_right(Src, Dest, rows, columns, Kernel, NRightShift) unsigned char *Src unsigned char *Dest int rows int columns Sint16 *Kernel unsigned char NRightShift CODE: RETVAL = SDL_imageFilterConvolveKernel3x3ShiftRight(Src, Dest, rows, columns, Kernel, NRightShift); OUTPUT: RETVAL convolve_kernel_5x5_shift_right int gfx_image_convolve_kernel_5x5_shift_right(Src, Dest, rows, columns, Kernel, NRightShift) unsigned char *Src unsigned char *Dest int rows int columns Sint16 *Kernel unsigned char NRightShift CODE: RETVAL = SDL_imageFilterConvolveKernel5x5ShiftRight(Src, Dest, rows, columns, Kernel, NRightShift); OUTPUT: RETVAL convolve_kernel_7x7_shift_right int gfx_image_convolve_kernel_7x7_shift_right(Src, Dest, rows, columns, Kernel, NRightShift) unsigned char *Src unsigned char *Dest int rows int columns Sint16 *Kernel unsigned char NRightShift CODE: RETVAL = SDL_imageFilterConvolveKernel7x7ShiftRight(Src, Dest, rows, columns, Kernel, NRightShift); OUTPUT: RETVAL convolve_kernel_9x9_shift_right int gfx_image_convolve_kernel_9x9_shift_right(Src, Dest, rows, columns, Kernel, NRightShift) unsigned char *Src unsigned char *Dest int rows int columns Sint16 *Kernel unsigned char NRightShift CODE: RETVAL = SDL_imageFilterConvolveKernel9x9ShiftRight(Src, Dest, rows, columns, Kernel, NRightShift); OUTPUT: RETVAL sobel_x int gfx_image_sobel_x(Src, Dest, rows, columns) unsigned char *Src unsigned char *Dest int rows int columns CODE: RETVAL = SDL_imageFilterSobelX(Src, Dest, rows, columns); OUTPUT: RETVAL sobel_x_shift_right int gfx_image_sobel_x_shift_right(Src, Dest, rows, columns, NRightShift) unsigned char *Src unsigned char *Dest int rows int columns unsigned char NRightShift CODE: RETVAL = SDL_imageFilterSobelXShiftRight(Src, Dest, rows, columns, NRightShift); OUTPUT: RETVAL align_stack void gfx_image_align_stack() CODE: SDL_imageFilterAlignStack(); restore_stack void gfx_image_restore_stack() CODE: SDL_imageFilterRestoreStack(); AUTHORS
See "AUTHORS" in SDL. perl v5.14.2 2012-05-28 pods::SDL::GFX::ImageFilter(3pm)
All times are GMT -4. The time now is 03:11 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy