LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-09-2016, 03:15 PM   #1
bash_noob
LQ Newbie
 
Registered: Feb 2016
Posts: 1

Rep: Reputation: Disabled
Exclamation bash script using aria2 not working


I found a bash script with wget here :
Code:
 http://www.linuxquestions.org/questions/showthread.php?p=5470985
I want to use aria2. its giving bad variable name. the script is:
Code:
 echo "Name"
read name
echo start no.
read incr
while read i 
  do 
    aria2c "$i" -x 16 -o $name_ep$incr
    incr=$((incr+1))
done < $name
Can anyone help me?
 
Old 02-09-2016, 03:52 PM   #2
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,252

Rep: Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685Reputation: 2685
You have no variable called "$name_ep". Assuming that should be the "name" variable, you will need to enclose in braces: "${name}_ep"

You should also get in the habit of quoting all variables unless you are 100 sure you do not need to.
 
Old 02-10-2016, 01:17 AM   #3
ondoho
Senior Member
 
Registered: Dec 2013
Posts: 4,176

Rep: Reputation: 837Reputation: 837Reputation: 837Reputation: 837Reputation: 837Reputation: 837Reputation: 837
is that the whole script?
what is it supposed to do, what are you trying to achieve?
 
  


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
Bash script not working Widgeteye Programming 10 12-27-2015 12:32 PM
[SOLVED] why is my delete bash script not working? BrinkofMadness Linux - Newbie 5 12-05-2010 10:43 AM
Help! Bash script not working cynthiatan General 2 11-10-2008 02:45 AM
bash script not working :'( aesahaettr Linux - Software 5 05-12-2004 02:08 AM
Bash script not working AMMullan Linux - General 2 09-28-2003 08:10 PM


All times are GMT -5. The time now is 05:16 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration