07-18-2008
write page source to standard output
I'm new to PERL, but I want to take the page source and write it to a file or standard output. I used perl.org as a test website. Here is the script:
use strict;
use warnings;
use LWP::Simple;
getprint('http://www.perl.org') or die 'Unable to get page';
exit 0;
When I run this, I get the following error:
"500 Can't connect to
The Perl Directory - perl.org (Bad hostname 'www.perl.org') <URL:http://www.perl.org>
Bear in mind I'm a Perl newbie, so I'm sure I'm missing something basic.
thanks in advance,
8 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I want to download a particular page from the internet and get the source code of the page in html format.
I want to parse the source code to find a specific parameters using grep command.
could someone tell me the linux command to download a specific page and parse the source code of it.
... (1 Reply)
Discussion started by: ahamed
1 Replies
2. UNIX for Dummies Questions & Answers
Hey, I'm completely new at this and I was wondering if there is a way that I would be able to redirect the log files in a directories standard output and standard error into and excel spreadsheet in anyway?
Please remember don't use too advanced of terminology as I just started using shell... (6 Replies)
Discussion started by: killaram
6 Replies
3. Shell Programming and Scripting
Hi all .... vexing problem here ...
I am using sed to replace some special characters in a .txt file:
sed -e 's/_<ED>_/_355_/g;s/_<F3>_/_363_/g;s/_<E1>_/_341_/g' filename.txt
This command replaces <ED> with í , <F3> with ó and <E1> with á.
When I run the command to standard output, it works... (1 Reply)
Discussion started by: crumplecrap
1 Replies
4. UNIX for Dummies Questions & Answers
Good afternoon,
I wonder how i could use unix commands to ease the reading of long command result output ?
like the "php -i" or any other command that returns a long answer.
I could not find the right terms to Google it or search the forum. Therefore I bother you with this question.
... (3 Replies)
Discussion started by: Mat_k
3 Replies
5. Shell Programming and Scripting
is it possible to pass webpages to remove all tag style information, but leave the tag...
say I have
<h1 style='font-size: xxx; color: xxxxxx'>headline 1</h1>
i want to get
<h1>headline 1</h1>
BTW, i got an oneliner here to remove all tags:
sed -n '/^$/!{s/<*>//g;p;
Thanks a... (4 Replies)
Discussion started by: dtdt
4 Replies
6. Shell Programming and Scripting
I have downloaded a web source page to a file. I then egrep a single word to extract a line containing it to another file.
I then cat the second file and remove everything before a word and after a second word to capture the phrase desired.
This did not work. I used vi to validate that the 2... (1 Reply)
Discussion started by: slak0
1 Replies
7. Shell Programming and Scripting
I need to get the source code of a webpage. I have tried to use wget and curl, but it doesn't show the necessary javascript part of the source. I don't have to execute it, only to view the source.
How do I do that? (1 Reply)
Discussion started by: locoroco
1 Replies
8. Red Hat
I ran the following command.
cat abc.c > abc.c
I got message the following message from command cat:
cat: abc.c : input file is same as the output file
How the command came to know of the destination file name as the command is sending output to standard file. (3 Replies)
Discussion started by: ravisingh
3 Replies
LEARN ABOUT REDHAT
msgunfmt
MSGUNFMT(1) GNU MSGUNFMT(1)
NAME
msgunfmt - uncompile message catalog from binary format
SYNOPSIS
msgunfmt [OPTION] [FILE]...
DESCRIPTION
Convert binary message catalog to Uniforum style .po file.
Mandatory arguments to long options are mandatory for short options too.
Operation mode:
-j, --java
Java mode: input is a Java ResourceBundle class
--tcl Tcl mode: input is a tcl/msgcat .msg file
Input file location:
FILE ...
input .mo files
If no input file is given or if it is -, standard input is read.
Input file location in Java mode:
-r, --resource=RESOURCE
resource name
-l, --locale=LOCALE
locale name, either language or language_COUNTRY
The class name is determined by appending the locale name to the resource name, separated with an underscore. The class is located using
the CLASSPATH.
Input file location in Tcl mode:
-l, --locale=LOCALE
locale name, either language or language_COUNTRY
-d DIRECTORY
base directory of .msg message catalogs
The -l and -d options are mandatory. The .msg file is located in the specified directory.
Output file location:
-o, --output-file=FILE
write output to specified file
The results are written to standard output if no output file is specified or if it is -.
Output details:
-e, --no-escape
do not use C escapes in output (default)
-E, --escape
use C escapes in output, no extended chars
--force-po
write PO file even if empty
-i, --indent
write indented output style
--strict
write strict uniforum style
-w, --width=NUMBER
set output page width
--no-wrap
do not break long message lines, longer than the output page width, into several lines
-s, --sort-output
generate sorted output
Informative output:
-h, --help
display this help and exit
-V, --version
output version information and exit
-v, --verbose
increase verbosity level
AUTHOR
Written by Ulrich Drepper.
REPORTING BUGS
Report bugs to <bug-gnu-gettext@gnu.org>.
COPYRIGHT
Copyright (C) 1995-1998, 2000-2002 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU-
LAR PURPOSE.
SEE ALSO
The full documentation for msgunfmt is maintained as a Texinfo manual. If the info and msgunfmt programs are properly installed at your
site, the command
info msgunfmt
should give you access to the complete manual.
GNU gettext 0.11.4 July 2002 MSGUNFMT(1)