Sponsored Content
Top Forums Shell Programming and Scripting need a shell script to extract the files from source file and check whether those files existonserve Post 302600488 by Scrutinizer on Tuesday 21st of February 2012 08:00:39 AM
Old 02-21-2012
Grep uses regular expressions and . has a special meaning, it means any character. To look for a . you need to escape it : \.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script to transfer the files from source to target server.

I need to write a shell script to transfer the files every hour from source - target server. The cron job should be running every hour and shouldn't copy already copied files to the remote server ? I was able to write intial script but not able to get the logic for (in the next run it should... (12 Replies)
Discussion started by: radhirk
12 Replies

2. Shell Programming and Scripting

HOW TO CHECK ONLY .C FILES EXISTS OR NOT IN A FOLDER using IF in C shell script?

Hi friends.. I hav a problem.... I dont know how to check .c files exists r not in a folder using IF in C shell script actually i tried like this if(=~ *.c) even though some .c files or there in the current folder..it is not entering int o the if control statement...... (17 Replies)
Discussion started by: p.hemadrireddy
17 Replies

3. Shell Programming and Scripting

Shell script to check the files hourly and purge

I'm new to shell scripting... i have been given a task.. can any one help in this regard.... 1) Check hourly for files in <destination-path><destination-file-template><destination-file-suffix> for files older than <destination-file-retention> days and purge. It should then check... (1 Reply)
Discussion started by: satishpabba
1 Replies

4. Shell Programming and Scripting

perl script to check if empty files are created and delete them and run a shell script

I have a local linux machine in which the files are dumped by a remote ubuntu server. If the process in remote server has any problem then empty files are created in local machine. Is there any way using perl script to check if the empty files are being created and delete them and then run a shell... (2 Replies)
Discussion started by: hussa1n
2 Replies

5. Shell Programming and Scripting

shell script to take input from a text file and perform check on each servers and copy files

HI all, I want to script where all the server names will be in a text file like server1 server2 server3 . and the script should take servernames from a text file and perform copy of files if the files are not present on those servers.after which it should take next servername till the end of... (0 Replies)
Discussion started by: joseph.dmello
0 Replies

6. Shell Programming and Scripting

Shell script to check files if exist else touch the file

Hi All, Thanks in Advance I wrote the following code if then echo "version is 1.1" for i in "subscriber promplan mapping dedicatedaccount faflistSub faflistAcc accumulator pam_account" do FILE="SDP_DUMP_$i.csv" echo "$FILE" ... (5 Replies)
Discussion started by: aealexanderraj
5 Replies

7. Shell Programming and Scripting

How to check whether directory has files in it or not in shell script?

hi, I am having script in which i want to check if directory has any file in it or not. If directory contains a single or more files then and only then it should proceed to further operations... P.S.: Directory might have thousand number of files. so there might be chance of getting error... (4 Replies)
Discussion started by: VSom007
4 Replies

8. Shell Programming and Scripting

Standardization of input source data files using shell script

Hi there, I'm a newbie in unix and am fishing for options related to how raw input data files are handled. The scenario, as I'm sure y'all must be very familiar with, is this : we receive upwards of 50 data files in ASCII format from various source systems - now each file has its own structure... (3 Replies)
Discussion started by: Prat Khos
3 Replies

9. Shell Programming and Scripting

Shell/perl script to check for files

Hi, I am trying to write a script for following scenario: I have a list of countries from where I receive files...eg. (Indonesia, Thailand, Australia...etc) For each country, I have a list of files that they send. IND -- a,b,c TH -- p,q,r AU -- x,y,z The path for these files could... (2 Replies)
Discussion started by: neil.k
2 Replies

10. Shell Programming and Scripting

Shell script to check a file and delete old files

Hello, I needed help with a shell script where in it checks if a file exists under a directory and also checks the age of the file and delete it if it is older than 3 weeks. thanks (10 Replies)
Discussion started by: hasn318
10 Replies
Perl::Critic::Policy::RegularExpressions::RequireExtendeUsermContributed PPerl::Critic::Policy::RegularExpressions::RequireExtendedFormatting(3pm)

NAME
Perl::Critic::Policy::RegularExpressions::RequireExtendedFormatting - Always use the "/x" modifier with regular expressions. AFFILIATION
This Policy is part of the core Perl::Critic distribution. DESCRIPTION
Extended regular expression formatting allows you mix whitespace and comments into the pattern, thus making them much more readable. # Match a single-quoted string efficiently... m{'[^\']*(?:\.[^\']*)*'}; #Huh? # Same thing with extended format... m{ ' # an opening single quote [^\'] # any non-special chars (i.e. not backslash or single quote) (?: # then all of... \ . # any explicitly backslashed char [^\']* # followed by an non-special chars )* # ...repeated zero or more times ' # a closing single quote }x; CONFIGURATION
You might find that putting a "/x" on short regular expressions to be excessive. An exception can be made for them by setting "minimum_regex_length_to_complain_about" to the minimum match length you'll allow without a "/x". The length only counts the regular expression, not the braces or operators. [RegularExpressions::RequireExtendedFormatting] minimum_regex_length_to_complain_about = 5 $num =~ m<(d+)>; # ok, only 5 characters $num =~ m<d.(d+)>; # not ok, 9 characters This option defaults to 0. Because using "/x" on a regex which has whitespace in it can make it harder to read (you have to escape all that innocent whitespace), by default, you can have a regular expression that only contains whitespace and word characters without the modifier. If you want to restrict this, turn on the "strict" option. [RegularExpressions::RequireExtendedFormatting] strict = 1 $string =~ m/Basset hounds got long ears/; # no longer ok This option defaults to false. NOTES
For common regular expressions like e-mail addresses, phone numbers, dates, etc., have a look at the Regexp::Common module. Also, be cautions about slapping modifier flags onto existing regular expressions, as they can drastically alter their meaning. See <http://www.perlmonks.org/?node_id=484238> for an interesting discussion on the effects of blindly modifying regular expression flags. TO DO
Add an exemption for regular expressions that contain "Q" at the front and don't use "E" until the very end, if at all. AUTHOR
Jeffrey Ryan Thalhammer <jeff@imaginative-software.com> COPYRIGHT
Copyright (c) 2005-2011 Imaginative Software Systems. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license can be found in the LICENSE file included with this module. perl v5.14.2 2012-0Perl::Critic::Policy::RegularExpressions::RequireExtendedFormatting(3pm)
All times are GMT -4. The time now is 06:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy