Unix Shell - web requests?

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > May 2007 > web requests?





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author web requests?
spacemarine@mailinator.com

2007-05-26, 7:21 am

hello,

i am new to unix shell scripting. i have a bash question: can scripts
make web requests?

on my network a win servers has code (.net) which i need to execute
from a unix-mac. i was thinking i could either use ssh to connect to
the win machine & execute an .exe of the code, or -- if the shell can
do web requests -- wrap it w/ a web service / asp.net page and hit it
from a bash script.

any thoughts?


thanks
sm

Bill Marcum

2007-05-26, 7:21 am

On 26 May 2007 00:12:09 -0700, spacemarine@mailinator.com
<spacemarine@mailinator.com> wrote:
>
>
> hello,
>
> i am new to unix shell scripting. i have a bash question: can scripts
> make web requests?
>
> on my network a win servers has code (.net) which i need to execute
> from a unix-mac. i was thinking i could either use ssh to connect to
> the win machine & execute an .exe of the code, or -- if the shell can
> do web requests -- wrap it w/ a web service / asp.net page and hit it
> from a bash script.
>
> any thoughts?
>

wget or lynx


--
Given its constituency, the only thing I expect to be "open" about [the
Open Software Foundation] is its mouth.
-- John Gilmore
spacemarine@mailinator.com

2007-05-26, 7:22 pm

On May 26, 3:54 am, Bill Marcum <marcumb...@bellsouth.net> wrote:

> wget or lynx


thanks. looks like wget was ditched from the latest os x in favor of
curl. but i found it and installed it.

this should work fine, im able to save pages. question -- does anybody
know the syntax (if its possible) to specify where to save a wget'd
html page? for instance, if i wanted to save the wget'd html page to:

/users/sm/logs/processed.html

i tried to rtfm first, but didnt see it:

http://www.gnu.org/software/wget/ma...html#URL-Format


thanks
sm

Dave Kelly

2007-05-27, 1:21 am

spacemarine@mailinator.com wrote:
> On May 26, 3:54 am, Bill Marcum <marcumb...@bellsouth.net> wrote:
>
>
> thanks. looks like wget was ditched from the latest os x in favor of
> curl. but i found it and installed it.
>
> this should work fine, im able to save pages. question -- does anybody
> know the syntax (if its possible) to specify where to save a wget'd
> html page? for instance, if i wanted to save the wget'd html page to:
>
> /users/sm/logs/processed.html
>
> i tried to rtfm first, but didnt see it:
>
> http://www.gnu.org/software/wget/ma...html#URL-Format
>
>
> thanks
> sm
>


Download:
-t, --tries=NUMBER set number of retries to NUMBER (0
unlimits).
--retry-connrefused retry even if connection is refused.
-O --output-document=FILE write documents to FILE.
-nc, --no-clobber don't clobber existing files or use .#
suffixes.
-c, --continue resume getting a partially-downloaded file.
--progress=TYPE select progress gauge type.
-N, --timestamping don't re-retrieve files unless newer
than local.
-S, --server-response print server response.
--spider don't download anything.
-T, --timeout=SECONDS set all timeout values to SECONDS.
--dns-timeout=SECS set the DNS lookup timeout to SECS.
--connect-timeout=SECS set the connect timeout to SECS.
--read-timeout=SECS set the read timeout to SECS.
-w, --wait=SECONDS wait SECONDS between retrievals.
--waitretry=SECONDS wait 1...SECONDS between retries of a
retrieval.
--random-wait wait from 0...2*WAIT secs between
retrievals.
-Y, --proxy=on/off turn proxy on or off.
-Q, --quota=NUMBER set retrieval quota to NUMBER.
--bind-address=ADDRESS bind to ADDRESS (hostname or IP) on
local host.
--limit-rate=RATE limit download rate to RATE.
--dns-cache=off disable caching DNS lookups.
--restrict-file-names=OS restrict chars in file names to ones OS
allows.


--
A little rum in the morning coffee. Just to clear the cobwebs, ya know.
spacemarine@mailinator.com

2007-05-27, 1:17 pm

On May 26, 9:24 pm, Dave Kelly <daveeke...@earthlink.net> wrote:
> Download:


thanks. i had noticed -O, but confused it w/ -o when i tried (case
sensitive!). that looks to do the job.


sm

Chris F.A. Johnson

2007-05-28, 7:19 am

On 2007-05-26, spacemarine@mailinator.com wrote:
> hello,
>
> i am new to unix shell scripting. i have a bash question: can scripts
> make web requests?


<http://cfaj.freeshell.org/shell/scripts/httpClient-sh>

> on my network a win servers has code (.net) which i need to execute
> from a unix-mac. i was thinking i could either use ssh to connect to
> the win machine & execute an .exe of the code, or -- if the shell can
> do web requests -- wrap it w/ a web service / asp.net page and hit it
> from a bash script.


If the Windows box has an ssh server, use ssh; it's the simplest.

--
Chris F.A. Johnson, author <http://cfaj.freeshell.org/shell/>
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
===== My code in this post, if any, assumes the POSIX locale
===== and is released under the GNU General Public Licence
spacemarine@mailinator.com

2007-05-28, 1:19 pm

On May 26, 8:02 am, "Chris F.A. Johnson" <cfajohn...@gmail.com> wrote:

> If the Windows box has an ssh server, use ssh; it's the simplest.


i ended up wrapping my win .exe code into an asp.net page (code
was .net)..works pretty well because calling it from curl/wget is a
breeze (even w/ authentication), and i have the page outputting its
status, so i can save the results of it to a local log file via curl.


thanks folks.

sm

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com