Sponsored Content
Top Forums Shell Programming and Scripting Perl if field begins with....... Post 302358112 by pludi on Thursday 1st of October 2009 11:29:58 AM
Old 10-01-2009
Rewrite
Code:
if $destination /^33/;

to
Code:
if ( $destination =~ /^33/ )

'if' doesn't need a semi-colon at the end, conditions should be in braces, and regular expressions are mapped with the '=~' operator.
 

7 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

remane a file that begins with $$$

I have a file named: $$$.p0001.ps how can I rename this file? I'm using the C shell. -westcoldspring (3 Replies)
Discussion started by: westcoldspring
3 Replies

2. Shell Programming and Scripting

[awk]: Row begins by random number and field 10 is greater than 10.00%

Hello! I wish to extract the pid where CPU is above 10% last pid: 22621; load averages: 4.71, 5.04, 5.13 15:08:34 221 processes: 212 sleeping, 2 running, 1 stopped, 6 on cpu CPU states: %... (3 Replies)
Discussion started by: Lomic
3 Replies

3. UNIX for Dummies Questions & Answers

how to tar directories that begins with 'sample_ZZZ'????

Hi, I have a bunch of images (8k) in several directories. I want to tar these directories up and unzip them to development and production with the same path. Example: /about/images/sample_01 /about/images/sample_02 /about/images/sample_03 /about/images/lorem_ipsum... (4 Replies)
Discussion started by: andylee80
4 Replies

4. Shell Programming and Scripting

field separator in Perl

is there a similar parameter you can set in perl like FS in awk? I think I've read all the tutorials on the subject, but cannot get this map split and so on thing to work. I need to sort a file by columns, eg. first, third, fifth... The script I need to add this column sorting is this: use... (38 Replies)
Discussion started by: ahsog
38 Replies

5. Shell Programming and Scripting

Printing the column that begins with certain words/numbers

Hi guys, I have got a file which doesn't have the same number of columns in each line. I would like to print the second column and the one that begins with 33= and has some numbers after '33=' Can you please help me asap? Cheers (7 Replies)
Discussion started by: alexandra_ola
7 Replies

6. Shell Programming and Scripting

Displaying the first field if the second field matches the pattern using Perl

Hi, I am trying with the below Perl command to print the first field when the second field matches the given pattern: perl -lane 'open F, "< myfile"; for $i (<F>) {chomp $i; if ($F =~ /patt$/) {my $f = (split(" ", $i)); print "$f";}} close F' dummy_file I know I can achieve the same with the... (7 Replies)
Discussion started by: royalibrahim
7 Replies

7. UNIX for Beginners Questions & Answers

Find number begins with 24

Hi Team, i need to list only those number from the input file which begin with 24 input file is 2412 2413 2456 2134 2134 2244 2526 expected output i want is 2412 2413 2456 (6 Replies)
Discussion started by: scriptor
6 Replies
stretch_blit(3alleg4)						  Allegro manual					     stretch_blit(3alleg4)

NAME
stretch_blit - Scales a rectangular area from one bitmap to another. Allegro game programming library. SYNOPSIS
#include <allegro.h> void stretch_blit(BITMAP *source, BITMAP *dest, int source_x, source_y, source_width, source_height, int dest_x, dest_y, dest_width, dest_height); DESCRIPTION
Like blit(), except it can scale images (so the source and destination rectangles don't need to be the same size) and requires the source and destination bitmaps to be of the same color depth. This routine doesn't do as much safety checking as the regular blit(): in particular you must take care not to copy from areas outside the source bitmap, and you cannot blit between overlapping regions, ie. you must use dif- ferent bitmaps for the source and the destination. Moreover, the source must be a memory bitmap. Example: BITMAP *bmp; ... /* Stretch bmp to fill the screen. */ stretch_blit(bmp, screen, 0, 0, bmp->w, bmp->h, 0, 0, SCREEN_W, SCREEN_H); SEE ALSO
blit(3alleg4), masked_stretch_blit(3alleg4), stretch_sprite(3alleg4), exalpha(3alleg4), exconfig(3alleg4), exscale(3alleg4), extrans(3alleg4), extrans2(3alleg4) Allegro version 4.4.2 stretch_blit(3alleg4)
All times are GMT -4. The time now is 05:59 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy