Click to See Complete Forum and Search --> : Passing a variable $CUE to the middle of a wget url


Unruly
10-15-2000, 06:12 PM
see title..

I'm trying to get this bash script to accept a variable in the middle of a url which wget is going to ... well ... get and it doesnt seem to like it... :(

any ideas...


#!/bin/bash
# \\ BashCat Script by Dirk van den Brink, Jr.
# \\ Takes raw data from a :Cue:Cat and
# \\ Uses it to retrieve data from Digital Convergence's
# \\ database and point a new Netflake Navigator
# \\ window to the associated URL.
clear
echo "Ready to scan..."
read CUE
# trim the crap from the front, and reverse case for
# getting info from DC's database.
CUE=echo $CUE | cut -b 7- - | tr A-Za-z a-zA-Z
wget -t2 -T1 -q -O ~/tmp/cuedata http://u.dcnv.com/CRQ/1..ACTIVATIONCODE.04'$CUE'.0
# nab the item description from that data
DESC=grep desc ~/tmp/cuedata | cut -c 6- -
# nab the URL from that data
URL=grep url ~/tmp/cuedata
# rm -f ~/tmp/cuedata
if test "$URL" == ""; then
echo "Your internet connection is dead or"
echo "DCNV.com is not responding. Sorry."
exit 1
fi
echo $DESC
echo -n $URL
netscape $URL


------------------
Nathan
Q: How many existentialists does it take to screw in a lightbulb?
A: Two. One to screw it in and one to observe how the lightbulb itself symbolizes a single incandescent beacon of subjective reality in a netherworld of endless absurdity reaching out toward a maudlin cosmos of nothingness.

:strain:
10-15-2000, 08:07 PM
I just tested this with snarf and....

[code]
BLAH=index.html; snarf http://ladeeda.com/${BLAH} worked just fine and downloaded the page no sweat