Sponsored Content
Top Forums Shell Programming and Scripting Sed inside bash script - accessing multiple files Post 302294667 by cfajohnson on Thursday 5th of March 2009 03:44:46 PM
Old 03-05-2009

Code:
grep -fv /usr/local/terms email > newemail

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Accessing redirected file inside script

hi, Is there a way to access the redirected file inside the script. Here is what the command line looks like: $ shar * > archive_file.arc I know I can't access the name of archive_file.arc with positional parameters like $1, $2.. Is there any way to figure out what file the output of the... (3 Replies)
Discussion started by: milhan
3 Replies

2. Shell Programming and Scripting

How to write bash script to explode multiple zip files

I have a directory full of zip files. How would I write a bash script to enumerate all the zip files, remove the ".zip" from the file name, create a directory by that name and unzip each zip file into its corresponding directory? Thanks! Siegfried (3 Replies)
Discussion started by: siegfried
3 Replies

3. Shell Programming and Scripting

Accessing Multiple files using for loop

Hi All, I have some files in my directory, and i want to pull all data using for loop....I am using following code but getting error..! for file in {file1, file2, file3, ..... filen} do L="$(tail -1 $file)";NUM=${L%%|*};DAT=${L##*|} echo $NUM>>filedata.txt done Error: tail:... (3 Replies)
Discussion started by: fidelis
3 Replies

4. Shell Programming and Scripting

bash script to compile multiple .c files with some options

I'm trying to write a bash script and call it "compile" such that running it allows me to compile multiple files with the options "-help," "-backup," and "-clean". I've got the code for the options written, i just can't figure out how to read the input string and then translate that into option... (5 Replies)
Discussion started by: travis.batzer
5 Replies

5. Shell Programming and Scripting

Bash script to copy timestamps of multiple files

Hi, I have a bunch of media files in a directory that have been converted (from MTS to MOV format), so my directory contains something like this: clip1.mts clip1.mov clip2.mts clip2.mov The problem is that the .mov files that have been created have the timestamps of the conversion task,... (2 Replies)
Discussion started by: Krakus
2 Replies

6. Shell Programming and Scripting

Bash script with python slicing on multiple data files

I have 2 files generated in linux that has common output and were produced across multiple hosts with the same setup/configs. These files do some simple reporting on resource allocation and user sessions. So, essentially, say, 10 hosts, with the same (2) system reporting in the files, so a... (0 Replies)
Discussion started by: jdubbz
0 Replies

7. Shell Programming and Scripting

Passing multiple files to awk for processing in bash script

Hi, I'm using awk command in bash script. I'm able to pass multiple files to awk for processing.The code i can use is as below(sample code) #!/bin/bash awk -F "," 'BEGIN { ... ... ... }' file1 file2 file3 In the above code i'm passing the file names manually and it is fine till my... (7 Replies)
Discussion started by: shree11
7 Replies

8. Shell Programming and Scripting

Loop through multiple files in bash script

Hi Everybody, I'm a newbie to shell scripting, and I'd appreciate some help. I have a bunch of .txt files that have some unwanted content. I want to remove lines 1-3 and 1028-1098. #!/bin/bash for '*.txt' in <path to folder> do sed '1,3 d' "$f"; sed '1028,1098 d' "$f"; done I... (2 Replies)
Discussion started by: BabyNuke
2 Replies

9. Shell Programming and Scripting

Need Multiple checks inside if condition in a bash shell script

Hi, I need to perform the untar and rm operation if the file found is a .tar and does not have test.tar or hello.tar as the file names. Below is the loop to check the same. for tf in *.tar do if ] then found=1 ... (1 Reply)
Discussion started by: mohtashims
1 Replies

10. Shell Programming and Scripting

Executing sed command inside a bash script

I want to run commands inside a bash script. An example is I want to pass the command in a string as regexp as an argument to the script, then run sed on the bash variable sed.sh regexp sed.sh "-i \"s/<p>//g\"" then call sed "$regexp" $fl (3 Replies)
Discussion started by: Kangol
3 Replies
Address(3pm)						User Contributed Perl Documentation					      Address(3pm)

NAME
Mail::RFC822::Address - Perl extension for validating email addresses according to RFC822 SYNOPSIS
use Mail::RFC822::Address qw(valid validlist); if (valid("pdw@ex-parrot.com")) { print "That's a valid address "; } if (validlist("pdw@ex-parrot.com, other@elsewhere.com")) { print "That's a valid list of addresses "; } DESCRIPTION
Mail::RFC822::Address validates email addresses against the grammar described in RFC 822 using regular expressions. How to validate a user supplied email address is a FAQ (see perlfaq9): the only sure way to see if a supplied email address is genuine is to send an email to it and see if the user recieves it. The one useful check that can be performed on an address is to check that the email address is syntactically valid. That is what this module does. This module is functionally equivalent to RFC::RFC822::Address, but uses regular expressions rather than the Parse::RecDescent parser. This means that startup time is greatly reduced making it suitable for use in transient scripts such as CGI scripts. valid ( address ) Returns true or false to indicate if address is an RFC822 valid address. validlist ( addresslist ) In scalar context, returns true if the parameter is an RFC822 valid list of addresses. In list context, returns an empty list on failure (an invalid address was found); otherwise a list whose first element is the number of addresses found and whose remaining elements are the addresses. This is needed to disambiguate failure (invalid) from success with no addresses found, because an empty string is a valid list. AUTHOR
Paul Warren, pdw@ex-parrot.com CREDITS
Most of the test suite in test.pl is taken from RFC::RFC822::Address, written by Abigail, abigail@foad.org COPYRIGHT and LICENSE This program is copyright 2001-2002 by Paul Warren. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. SEE ALSO
RFC::RFC822::Address, Mail::Address perl v5.10.1 2002-04-13 Address(3pm)
All times are GMT -4. The time now is 01:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy