I spent the whole night trying to get the proccess done but all my attempts ends with failure.
I write a very simple script to clear what I'm trying to do please copy it and try to power it up.
#!/bin/bash
set -x
urls='http://bellatrix.oron.com/jrmxp36wf36yew4veg4fp53kmwlogjeecmopy3n2ja5yqkyzekxwqx2pckq6dtd5hb7duvgk/An-Beat - Mentally Insine (Original Mix).mp3'
#urls="http://bellatrix.oron.com/jrmxp36wf36yew4veg4fp53kmwlogjeecmopy3n2ja5yqkyzekxwqx2pckq6dtd5hb7duvgk/An-Beat - Mentally Insine (Original Mix).mp3"
for letsgo in `curl -OLJg "'${urls}'"` ; do
echo "GOT TRIED OF TRYING"
done
# for letsgo in `curl -OLJg $urls` ; do
#echo "GOT TRIED OF TRYING"
# done
The result which I got after starting it up
First Loop Way:-
./ap2.sh
+ urls='http://bellatrix.oron.com/jrmxp36wf36yew4veg4fp53kmwlogjeecmopy3n2ja5yqkyzekxwqx2pckq6dtd5hb7duvgk/An-Beat - Mentally Insine (Original Mix).mp3'
++ curl -OLJg ''\''http://bellatrix.oron.com/jrmxp36wf36yew4veg4fp53kmwlogjeecmopy3n2ja5yqkyzekxwqx2pckq6dtd5hb7duvgk/An-Beat - Mentally Insine (Original Mix).mp3'\'''
curl: (1) Protocol 'http not supported or disabled in libcurl
+ for letsgo in '`curl -OLJg "'\''${urls}'\''"`'
+ echo 'GOT TRIED OF TRYING'
GOT TRIED OF TRYING
Second Loop
./ap2.sh
+ urls='http://bellatrix.oron.com/jrmxp36wf36yew4veg4fp53kmwlogjeecmopy3n2ja5yqkyzekxwqx2pckq6dtd5hb7duvgk/An-Beat - Mentally Insine (Original Mix).mp3'
++ curl -OLJg http://bellatrix.oron.com/jrmxp36wf36yew4veg4fp53kmwlogjeecmopy3n2ja5yqkyzekxwqx2pckq6dtd5hb7duvgk/An-Beat - Mentally Insine '(Original' 'Mix).mp3'
curl: option -: is unknown
curl: try 'curl --help' or 'curl --manual' for more information
The problem is something I don't know where is escaping the url without my permission and get the things not to work probably.
Update
I get rid of it by using
for letsgo in `curl -OLJg "${urls}"` ; do
echo "Working Fine But We Still Have Problem When We Are Using More Than 1 URL"
done
The problem when the script have more than one more url each of them must be in quotes (Only for my case) to get the curl working probably. I can do it manually in linux console without any problem but when it comes to using a BASH script the result of these script will be
#!/bin/bash
set -x
urls="'http://bellatrix.oron.com/jrmxp36wf36yew4veg4fp53kmwlogjeecmopy3n2ja5yqkyzekxwqx2pckq6dtd5hb7duvgk/An-Beat - Mentally Insine (Original Mix).mp3' -OLJg 'http://webprod15.megashares.com/index.php?d01=3109985&lccdl=9e8e091ef33dd103&d01go=1' -OLJg "
for letsgo in `curl -OLJg "${urls}"` ; do
echo "Working Fine But We Still Have Problem When We Are Using More Than 1 URL"
done
Results:-
+ urls=''\''http://bellatrix.oron.com/jrmxp36wf36yew4veg4fp53kmwlogjeecmopy3n2ja5yqkyzekxwqx2pckq6dtd5hb7duvgk/An-Beat - Mentally Insine (Original Mix).mp3'\'' -OLJg '\''http://webprod15.megashares.com/index.php?d01=3109985&lccdl=9e8e091ef33dd103&d01go=1'\'' '
++ curl -OLJg ''\''http://bellatrix.oron.com/jrmxp36wf36yew4veg4fp53kmwlogjeecmopy3n2ja5yqkyzekxwqx2pckq6dtd5hb7duvgk/An-Beat - Mentally Insine (Original Mix).mp3'\'' -OLJg '\''http://webprod15.megashares.com/index.php?d01=3109985&lccdl=9e8e091ef33dd103&d01go=1'\'' '
curl: (1) Protocol 'http not supported or disabled in libcurl
+ for letsgo in '`curl -OLJg "${urls}"`'
+ echo 'Working Fine But We Still Have Problem When We Are Using More Than 1 URL'
Working Fine But We Still Have Problem When We Are Using More Than 1 URL
I just want it to work normally the same way as I enter it on linux console without the interrupting which made by bash by escaping strings. Like this way
curl -OLJg 'http://bellatrix.oron.com/jrmxp36wf36yew4veg4fp53kmwlogjeecmopy3n2ja5yqkyzekxwqx2pckq6dtd5hb7duvgk/An-Beat - Mentally Insine (Original Mix).mp3' -OLJg 'http://webprod15.megashares.com/index.php?d01=3109985&lccdl=9e8e091ef33dd103&d01go=1' -OLJ