02-11-2009
Please help modify solution
I am trying to extract .co.uk domains from html,
using the command:
cat $DIR/oldfile.txt | tr " " "\n" | grep [A-Za-z0-9_\.-].co.uk > $DIR/newfile.txt
The problem is that this command matches:
/>domain.co.uk<br
/>domain.co.uk<br
/>domain.co.uk<br
etc
How do I modify my regexp to match alphanumeric chars only? (apart from the dots and possible hyphens)
Many Thanks,
Hal
10 More Discussions You Might Find Interesting
1. IP Networking
hey what the hell happens if you make sure (as best one can) that a domain name like anything.com is not used at all, and you set up your own DNS and use that name without registering with a registrar, i know if the address is in use you will make some people very upset and give many internet users... (2 Replies)
Discussion started by: norsk hedensk
2 Replies
2. UNIX for Dummies Questions & Answers
Hi,
We're an internet company with several domain names. Our mail server was originally set up to deal with xxx@domain1.com email addresses which works fine.
The problem I have is that we're now also using a domain2.com, and sales@domain1.com isn't the same as sales@domain2.com.
I've added... (1 Reply)
Discussion started by: captainash
1 Replies
3. Shell Programming and Scripting
Hi,
I have to perform an iterative function on a set of 10 files. After the first round the output files are named differently than the input files.
examples
input file name = xxxx1.yyy
output file name = xxxx1_0001.yyy
I need to rename all of the output files to the original input... (5 Replies)
Discussion started by: ligander
5 Replies
4. Shell Programming and Scripting
Hello,
i have a file contains the information like below
/home/username/domain.com/log/access
/home/username/domain23.net/log/access
/home/reseller/username/domain.com/log/access
using a loop i can read every line of the file but i wants to extract domain name like(domain.com,... (3 Replies)
Discussion started by: eyes_drinker
3 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I have some ps files where I want to ectract/copy a certain number from and use that number to rename the ps file.
eg:
'file.ps' contains following text:
14 (09 01 932688 0)t
the text can be variable, the only fixed element is the '14 ('. The problem is that the fixed element can appear... (7 Replies)
Discussion started by: JohnDS
7 Replies
6. UNIX for Advanced & Expert Users
Hi All,
The following is the sample xml which is generated by a tool called HUDSON when ever change occurs in SVN(Sub version namespace).
In the given XML , path/paths tags ll be vary depends on no.of changes.
now , my requirement is, need a script which can extract the payment and... (1 Reply)
Discussion started by: geervani
1 Replies
7. Shell Programming and Scripting
Hello I have a large file with lines beginning with 552, 553, 554, below is a small sample, I need to extract the data you can see below highlighted in bold from this file on the same location on every line and output it to a new file.
Thank you in advance for any help
55201KL... (2 Replies)
Discussion started by: firefox2k2
2 Replies
8. UNIX for Dummies Questions & Answers
Hi,
I am trying to extract lines from a text file given a text file containing line numbers to be extracted from the first file. How do I go about doing this? Thanks! (1 Reply)
Discussion started by: evelibertine
1 Replies
9. UNIX for Dummies Questions & Answers
I am totally new to shell scripting. I want to see people from which domain access my website. I want to generate the domain names from IP addresses in the Apache access.log file.
There are around 54 log files. I concatenate all the files into one.
I am using Ubuntu 12.04 LTS.
So I... (4 Replies)
Discussion started by: Ronni
4 Replies
10. UNIX for Dummies Questions & Answers
I have a file like this:
http://article.wn.com/view/2010/11/26/IV_drug_policy_feels_HIV_patients_Red_Cross/ http://aidsjournal.com/,www.cfpa.org.cn/page1/page2 , www.youtube.com
http://seattletimes.nwsource.com/html/jerrybrewer/2013517803_brewer25.html... (1 Reply)
Discussion started by: csim_mohan
1 Replies
UNZIP(1) BSD General Commands Manual UNZIP(1)
NAME
unzip -- extract files from a ZIP archive
SYNOPSIS
unzip [-aCcfjLlnopqtuvy] [-d dir] [-x pattern] zipfile
DESCRIPTION
The following options are available:
-a When extracting a text file, convert DOS-style line endings to Unix-style line endings.
-C Match file names case-insensitively.
-c Extract to stdout/screen. When extracting files from the zipfile, they are written to stdout. This is similar to -p, but
doesn't suppress normal output.
-d dir Extract files into the specified directory rather than the current directory.
-f Update existing. Extract only files from the zipfile if a file with the same name already exists on disk and is older than the
former. Otherwise, the file is silently skipped.
-j Ignore directories stored in the zipfile; instead, extract all files directly into the extraction directory.
-L Convert the names of the extracted files and directories to lowercase.
-l List, rather than extract, the contents of the zipfile.
-n No overwrite. When extracting a file from the zipfile, if a file with the same name already exists on disk, the file is silently
skipped.
-o Overwrite. When extracting a file from the zipfile, if a file with the same name already exists on disk, the existing file is
replaced with the file from the zipfile.
-p Extract to stdout. When extracting files from the zipfile, they are written to stdout. The normal output is suppressed as if -q
was specified.
-q Quiet: print less information while extracting.
-t Test: do not extract anything, but verify the checksum of every file in the archive.
-u Update. When extracting a file from the zipfile, if a file with the same name already exists on disk, the existing file is
replaced with the file from the zipfile if and only if the latter is newer than the former. Otherwise, the file is silently
skipped.
-v List verbosely, rather than extract, the contents of the zipfile. This differs from -l by using the long listing. Note that
most of the data is currently fake and does not reflect the content of the archive.
-x pattern Exclude files matching the pattern pattern.
-y Print four digit years in listings instead of two.
Note that only one of -n, -o, and -u may be specified.
ENVIRONMENT
If the UNZIP_DEBUG environment variable is defined, the -q command-line option has no effect, and additional debugging information will be
printed to stderr.
COMPATIBILITY
The unzip utility aims to be sufficiently compatible with other implementations to serve as a drop-in replacement in the context of the
pkgsrc(7) system. No attempt has been made to replicate functionality which is not required for that purpose.
For compatibility reasons, command-line options will be recognized if they are listed not only before but also after the name of the zipfile.
Normally, the -a option should only affect files which are marked as text files in the zipfile's central directory. Since the archive(3)
library reads zipfiles sequentially, and does not use the central directory, that information is not available to the unzip utility.
Instead, the unzip utility will assume that a file is a text file if no non-ASCII characters are present within the first block of data
decompressed for that file. If non-ASCII characters appear in subsequent blocks of data, a warning will be issued.
The unzip utility is only able to process ZIP archives handled by libarchive(3). Depending on the installed version of libarchive(3), this
may or may not include self-extracting archives.
SEE ALSO
libarchive(3)
HISTORY
The unzip utility appeared in NetBSD 6.0.
AUTHORS
The unzip utility and this manual page were written by Dag-Erling Smorgrav <des@FreeBSD.org>. It uses the archive(3) library developed by
Tim Kientzle <kientzle@FreeBSD.org>.
BUGS
The unzip utility currently does not support asking the user whether to overwrite or skip a file that already exists on disk. To be on the
safe side, it will fail if it encounters a file that already exists and neither the -n nor the -o command line option was specified.
BSD
August 18, 2011 BSD