Sponsored Content
Full Discussion: Pattern matching in BASH
Top Forums Shell Programming and Scripting Pattern matching in BASH Post 302112716 by zoo591 on Thursday 29th of March 2007 05:36:00 PM
Old 03-29-2007
MySQL

I am not sure the reason for the syntax error even though
shopt -s extglob had been used. In the end I used this command
as an alternative to 'cp' and it seems to do the trick.

Thanks Reborg for trying. You have helped me much in the past.

ACCEPTED ANSWER:
rsync -avz --exclude=000po.k --exclude=166po.k --exclude=168po.k $SRC/*.k $TGT/
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

bash pattern matching echo *[! '/' ] doesn't work

without using ls, just using echo so purely pattern matching I can say echo */ <-- lists directories but how would I match files? surely something like *!/ or * but neither work ? it seems like there isn't much that I can put in but surely i should be able to put any ascii... (1 Reply)
Discussion started by: james hanley
1 Replies

2. Shell Programming and Scripting

bash script, pattern matching + sum

Hi guys, i have been struggling to achieve the following and therefor looking for some help. I am trying to write something that will summerize the following output from my switches for daily totals. Basicly if $1 $2 $3 doesnt change, we can keep adding up $4. Probably would use a awk print end... (3 Replies)
Discussion started by: Wratholix
3 Replies

3. Shell Programming and Scripting

comment/delete a particular pattern starting from second line of the matching pattern

Hi, I have file 1.txt with following entries as shown: 0152364|134444|10.20.30.40|015236433 0233654|122555|10.20.30.50|023365433 ** ** ** In file 2.txt I have the following entries as shown: 0152364|134444|10.20.30.40|015236433 0233654|122555|10.20.30.50|023365433... (4 Replies)
Discussion started by: imas
4 Replies

4. Shell Programming and Scripting

counting the lines matching a pattern, in between two pattern, and generate a tab

Hi all, I'm looking for some help. I have a file (very long) that is organized like below: >Cluster 0 0 283nt, >01_FRYJ6ZM12HMXZS... at +/99% 1 279nt, >01_FRYJ6ZM12HN12A... at +/99% 2 281nt, >01_FRYJ6ZM12HM4TS... at +/99% 3 283nt, >01_FRYJ6ZM12HM946... at +/99% 4 279nt,... (4 Replies)
Discussion started by: d.chauliac
4 Replies

5. Shell Programming and Scripting

sed - matching pattern one but not pattern two

All, I have the following file: -------------------------------------- # # /etc/pam.d/common-password - password-related modules common to all services # # This file is included from other service-specific PAM config files, # and should contain a list of modules that define the services... (2 Replies)
Discussion started by: RobertBerrie
2 Replies

6. UNIX for Dummies Questions & Answers

Find pattern suffix matching pattern

Hi, I am trying to get a result out of this but fails please help. Have two files /tmp/1 & /tmp/hosts. /tmp/1 IP=123.456.789.01 WAS_HOSTNAME=abcdefgh.was.tb.dsdc /tmp/hosts 123.456.789.01 I want this result in /tmp/hosts if hostname is already there dont want duplicate entry. ... (5 Replies)
Discussion started by: rajeshwebspere
5 Replies

7. Shell Programming and Scripting

Sed: printing lines AFTER pattern matching EXCLUDING the line containing the pattern

'Hi I'm using the following code to extract the lines(and redirect them to a txt file) after the pattern match. But the output is inclusive of the line with pattern match. Which option is to be used to exclude the line containing the pattern? sed -n '/Conn.*User/,$p' > consumers.txt (11 Replies)
Discussion started by: essem
11 Replies

8. Shell Programming and Scripting

PHP - Regex for matching string containing pattern but without pattern itself

The sample file: dept1: user1,user2,user3 dept2: user4,user5,user6 dept3: user7,user8,user9 I want to match by '/^dept2.*/' but don't want to have substring 'dept2:' in output. How to compose such regex? (8 Replies)
Discussion started by: urello
8 Replies

9. Shell Programming and Scripting

Bash pattern matching question

I need to check the condition of a variable before the script continues and it needs to match a specific pattern such as EPS-03-0 or PDF-02-1. The first part is a 3 or 4 letter string followed by a hyphen, then a 01,02 or 03 followed by a hyphen then a 0 or a 1. I know I could check for every... (4 Replies)
Discussion started by: stormcel
4 Replies

10. UNIX for Dummies Questions & Answers

Grep -v lines starting with pattern 1 and not matching pattern 2

Hi all! Thanks for taking the time to view this! I want to grep out all lines of a file that starts with pattern 1 but also does not match with the second pattern. Example: Drink a soda Eat a banana Eat multiple bananas Drink an apple juice Eat an apple Eat multiple apples I... (8 Replies)
Discussion started by: demmel
8 Replies
Test::CheckManifest(3pm)				User Contributed Perl Documentation				  Test::CheckManifest(3pm)

NAME
Test::CheckManifest - Check if your Manifest matches your distro VERSION
version 1.25 SYNOPSIS
use Test::CheckManifest; ok_manifest(); DESCRIPTION
"Test::CheckManifest" EXPORT There is only one method exported: "ok_manifest" METHODS
ok_manifest [{exclude => $arref}][$msg] checks whether the Manifest file matches the distro or not. To match a distro the Manifest has to name all files that come along with the distribution. To check the Manifest file, this module searches for a file named "MANIFEST". To exclude some directories from this test, you can specify these dirs in the hashref. ok_manifest({exclude => ['/var/test/']}); is ok if the files in "/path/to/your/dist/var/test/" are not named in the "MANIFEST" file. That means that the paths in the exclude array must be "pseudo-absolute" (absolute to your distribution). To use a "filter" you can use the key "filter" ok_manifest({filter => [qr/.svn/]}); With that you can exclude all files with an '.svn' in the filename or in the path from the test. These files would be excluded (as examples): o /dist/var/.svn/test o /dist/lib/test.svn You can also combine "filter" and "exclude" with 'and' or 'or' default is 'or': ok_manifest({exclude => ['/var/test'], filter => [qr/.svn/], bool => 'and'}); These files have to be named in the "MANIFEST": o /var/foo/.svn/any.file o /dist/t/file.svn o /var/test/test.txt These files not: o /var/test/.svn/* o /var/test/file.svn EXCLUDING FILES
Beside "filter" and "exclude" there is another way to exclude files: "MANIFEST.SKIP". This is a file with filenames that should be excluded: t/my_very_own.t file_to.skip ACKNOWLEDGEMENT
Great thanks to Christopher H. Laco, who did a lot of testing stuff for me and he reported some bugs to RT. AUTHOR
Renee Baecker, <module@renee-baecker.de> COPYRIGHT AND LICENSE
Copyright (C) 2006 - 2011 by Renee Baecker This library is free software; you can redistribute it and/or modify it under the same terms as Artistic License 2.0 AUTHOR
Renee Baecker <module@renee-baecker.de> COPYRIGHT AND LICENSE
This software is Copyright (c) 2011 by Renee Baecker. This is free software, licensed under: The Artistic License 2.0 (GPL Compatible) perl v5.14.2 2012-01-31 Test::CheckManifest(3pm)
All times are GMT -4. The time now is 03:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy