[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lynx-dev Long URL on command line
From: |
Christopher Allen [BigFatPipe.Net] |
Subject: |
Re: lynx-dev Long URL on command line |
Date: |
Tue, 28 Nov 2000 11:19:37 -0800 (PST) |
On Tue, 28 Nov 2000, Klaus Weide wrote:
> > >Context: I want to send a long URL on the command line and have the
> > >results
> > >dump-ed. I'm currently using "/usr/local/bin/lynx -dump -nolist $url",
...snip...
> No, that would be the right advice for embedding a URL in HTML (as an HREF
> attribute value or otherwise), but not for the command line.
> Lynx would be wrong if it interpreted & that is part of a URL passed
> on the command line as &.
The catch (and somebody mentioned this) is that the & will background the
process at the command line.
Your $url variable would need to have the & character escaped... ex. \&.
If you're doing this from within something like a Perl script, and called:
$url = "http://your.server/cgi/dothis?action=something&reason=becauseisaidso";
system("/usr/local/bin/lynx -dump -nolist $url");
The shell would receive that command as:
/usr/local/bin/lynx -dump -nolist
http://your.server/cgi/dothis?action=something&reason=becauseisaidso
and would execute it as two commands, the second of which should error
out:
/usr/local/bin/lynx -dump -nolist
http://your.server/cgi/dothis?action=something&
reason=becauseisaidso
Now... if you changed the $url varilable to the following:
$url = "http://your.server/cgi/dothis?action=something\&reason=becauseisaidso";
It would execute as:
/usr/local/bin/lynx -dump -nolist
http://your.server/cgi/dothis?action=something\&reason=becauseisaidso
And after your shell interprets the escaped character, Lynx would receive
the $ARGV values as:
$ARGV[0] -dump
$ARGV[1] -nolist
$ARGV[2]
http://your.server/cgi/dothis?action=something&reason=becauseisaids
-CA
-- Christopher R. Allen --- address@hidden --
-- (503) 921-2354 -- http://www.bigfatpipe.net --
; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden