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 CENTOS
repstopdf
EPSTOPDF(1) General Commands Manual EPSTOPDF(1)
NAME
epstopdf, repstopdf - convert an EPS file to PDF
SYNOPSIS
epstopdf [options] [epsfile]
DESCRIPTION
epstopdf transforms the Encapsulated PostScript file epsfile (or standard input) so that it is guaranteed to start at the 0,0 coordinate,
and it sets a page size exactly corresponding to the BoundingBox. This means that when Ghostscript renders it, the result needs no crop-
ping, and the PDF MediaBox is correct. By default, the result is piped to Ghostscript and a PDF version written.
If the bounding box is not right, of course, there are problems.
OPTIONS
--outfile=file
write result to file. If this option is not given, and --nogs or --filter is specified, write to standard output; otherwise, the
default is to construct the output file name by replacing any extension in the input file with .pdf.
--[no]compress
use compression (default: on).
--[no]debug
write debugging info (default: off).
--[no]embed
embed fonts (default: on).
--[no]exact
scan ExactBoundingBox (default: off).
--[no]filter
read standard input and (unless --outfile is given) write standard output(default: off).
--[no]gs
run Ghostscript (default: on). With --nogs, output (to standard output by default) the PostScript that would normally be converted;
that is, the input PostScript as modified by epstopdf.
--[no]hires
scan HiresBoundingBox (default: off).
--gscmd=val
pipe output to val (default: [gswin32c on Windows, else gs])
--res=dpi
set image resolution (default: [use gs default])
--autorotate=val
set AutoRotatePages (default: None); recognized val choices: None, All, PageByPage. For EPS files, PageByPage is equivalent to All.
--restricted=val
turn on restricted mode (default: [on for repstopdf, else off]); this forbids the use of --gscmd and imposes restrictions on the
input and output file names according to the values of openin_any and openout_any (see the Web2c manual, http://tug.org/web2c).
--help display help message and exit
--version
display version information and exit
EXAMPLES
Examples which produce "test.pdf":
epstopdf test.eps
produce postscript | epstopdf --filter >test.pdf
produce postscript | epstopdf -f -d -o=test.pdf
Example: look for HiresBoundingBox and produce corrected PostScript:
epstopdf -d --nogs --hires test.ps >testcorr.ps
BUGS
The case of "%%BoundingBox: (atend)" when input is not seekable (e.g., from a pipe) is not supported.
Report bugs in the program or this man page to tex-k@tug.org. When reporting bugs, please include an input file and the command line
options specified, so the problem can be reproduced.
SEE ALSO
gs(1), pdfcrop(1).
The epstopdf LaTeX package, part of the oberdiek bundle, which automates running this script on the fly under TeX:
http://ctan.org/pkg/epstopdf-pkg.
AUTHOR
The script was originally written by Sebastian Rahtz, for Elsevier Science, with subsequent contributions from Thomas Esser, Gerben Wierda
and many others. Currently maintained by Karl Berry.
Man page originally written by Jim Van Zandt.
epstopdf home page: http://tug.org/epstopdf.
You may freely use, modify and/or distribute this file.
18 March 2010 EPSTOPDF(1)