Solved

wget from local directory

Posted on 2013-05-31
3
317 Views
Last Modified: 2013-06-06
Greetings,
In a production environment, I am pulling an html page using wget.

wget http://url.com/file.htm
no problem.

but in a development environment I am not allowed to get to the http.  They are manually dropping file.htm onto my server and expect me to code from there.

is there a way to wget from a local directory?
ie.
wget /var/tmp/file1.htm

Thanks
0
Comment
Question by:Evan Cutler
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 23

Expert Comment

by:nemws1
ID: 39211265
I'm assuming this is in a shell script.

Can you just comment out the 'wget' line and put this on the next line instead:
cp /var/tmp/file1.htm .

Open in new window


You'll have to switch them back around when you copy to production.  Put that caveat in your release notes so you remember to do it when you go to deploy.
0
 
LVL 23

Accepted Solution

by:
nemws1 earned 500 total points
ID: 39211280
BTW - 'wget' does not support the file:// scheme, so this does not work:

wget -q -O test.htm file:///var/tmp/file1.htm

Open in new window


But 'curl' *does* support the file:// scheme, so this one does work:

curl -s file:///var/tmp/file1.htm > test.htm

Open in new window

0
 
LVL 9

Author Closing Comment

by:Evan Cutler
ID: 39225928
That'll work.
Thanks.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Bash Script to Analyze Oracle Schemas 11 128
How to Remove files with a Date in the Filename with Linux Scripting 3 64
sqlldr issue 1 35
UNIX Script. Send email if failure 8 93
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Over the years I've spent many an hour playing on hardened, DMZ'd servers, with only a sub-set of the usual GNU toy's to keep me company; frequently I've needed to save and send log or data extracts from these server back to my PC, or to others, and…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question