LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-25-2005, 06:08 AM   #1
pete1234
Member
 
Registered: May 2005
Distribution: Slack, FreeBSD,NetBSD, OpenBSD, Open Solaris, Minix
Posts: 172

Rep: Reputation: 30
Yet another bash question.


So I'm writing this script to pull a bunch of radio shows from an archive, and after a certain year the host switched over to html that looks something like this:

<a href="../mp3files/1203.mp3">
When the file is actually stored in http://www.show.com/mp3files/1203.mp3

I attempted to modify my script in this fashion:

LIST="$(grep -o /mp3files/"$1"/show__"$1""$y_text"...mp3 "$2")"

for mp3 in "$LIST"; do
wget http://www.show.com/show$mp3

However this doesn't work. It will download the first file, but then I get the equivalent of
/mp3files/"$1"/show__"$1""$y_text"...mp3: Unsupported scheme.

So I can't figure out why http://www.show.com/show/ is only passed to one file. Any help is appreciated.

Last edited by pete1234; 09-25-2005 at 06:34 AM.
 
Old 09-25-2005, 06:40 AM   #2
nixcraft
Member
 
Registered: Nov 2004
Location: BIOS
Distribution: RHEL3.0, FreeBSD 5.x, Debian 3.x, Soaris x86 v10
Posts: 379

Rep: Reputation: 30
Try to replace

wget http://www.show.com/show$mp3


with
wget http://www.show.com/show${mp3}

It is better if you put you script here so that any one can correct it.
 
Old 09-25-2005, 09:38 AM   #3
eddiebaby1023
Member
 
Registered: May 2005
Posts: 378

Rep: Reputation: 33
You really need to understand how shell quoting works.
 
Old 09-25-2005, 03:22 PM   #4
pete1234
Member
 
Registered: May 2005
Distribution: Slack, FreeBSD,NetBSD, OpenBSD, Open Solaris, Minix
Posts: 172

Original Poster
Rep: Reputation: 30
I still get the same error, and the first file fails aswell.

Code:

y_num=0
y_text="00"

until [ $y_text == "12" ]; do

let y_num=y_num+1

y_text=""

if [ ${#y_num} -eq 1 ] ; then
y_text="0"
fi

y_text="${y_text}${y_num}"

wget http://www.show.com/show/"$1"/"$y_text""$2".html -O "$2"

LIST="$(grep -o /mp3files/"$1"/show__"$1""$y_text"....mp3 "$2")"

for mp3 in "$LIST"; do
wget wget http://www.show.com/show${mp3}
done
done
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
A question about BASH operand Linux - Newbie 2 11-27-2005 09:49 PM
BASH question robscott Linux - Software 3 11-23-2005 09:39 AM
Bash question lnxduck Programming 3 09-30-2005 08:50 AM
bash question? shanenin Linux - Software 1 11-26-2004 12:22 PM
little bash question gplacek Linux - General 2 09-01-2004 12:10 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration