![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| wget --dns-timeout script | veerumahanthi41 | UNIX for Dummies Questions & Answers | 1 | 12-08-2008 02:09 AM |
| help with wget script. | veerumahanthi41 | Shell Programming and Scripting | 3 | 11-30-2008 11:23 PM |
| How to script wget in bash? | siegfried | Shell Programming and Scripting | 1 | 12-25-2007 03:57 AM |
| Script to download file using wget | techie82 | Shell Programming and Scripting | 1 | 02-13-2007 07:45 PM |
| Wget call in a Perl script | rahulrathod | UNIX for Advanced & Expert Users | 1 | 12-28-2005 06:45 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Using wget in a Perl script
Hi, I've written a script in Perl that generates a URL and prints it. So if I run the script from the command line, I get something like this: Code:
$ script.pl http://www.url.com/folder/file.ext I would like to use this script with wget to download the file at the URL generated. Is there a simple way to redirect the output of a perl script to wget so that I can download the file using the script? I couldn't think of any way to do this, so my thought was to output the URL to a file, then write a shell script to read the contents of the file and call wget with the correct URL, but this seems like an unnecessarily complicated solution. Is there an easy way to call wget from a Perl script? Thanks for any help! |
|
||||
|
Thats easy! Just use either backticks or.. var substitution.. such as.. Code:
test=$(perl -e "print 'Hi hi hi hi';");echo $test; or... Code:
echo `perl -e "print 'Hello World';"` So you could easily do.. Code:
wget `perl script.pl` Have fun! |
![]() |
| Bookmarks |
| Tags |
| perl, wget |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|