LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 06-01-2020, 08:53 AM   #16
TashiDuks
Member
 
Registered: Sep 2010
Posts: 54

Original Poster
Rep: Reputation: 0
Angry


Quote:
Originally Posted by TB0ne View Post
Don't post the same question multiple times; duplicate reported.
Oh please. If you cant help others, don't try messing bro. I am not that stupid to re-post same question here. This question is just a example which I currently working.

your mind is so dirty bro. keep your hands away if you can't help others.

no one is forcing you to answer.

NO ONE IS LUCKY LIKE YOU!!!!!!!!!!!!!!!!!!

Last edited by TashiDuks; 06-01-2020 at 08:57 AM.
 
Old 06-01-2020, 08:56 AM   #17
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,753

Rep: Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983
Quote:
Originally Posted by TashiDuks View Post
So basically what you mean is, the person who are here in this forum for more than 10 year should be expert? I would expect some help rather than return questions what has been asked. Anyways, thanks for keeping track of my account and my knowledge.
And we would expect someone with ten years experience and at least four years asking about shell-scripts to know how to write a simple shell script; especially since you've asked about bash scripts and looping before, and even know about shellcheck. And you didn't answer the question about this being homework, because saying what it 'demands' makes it sound like a teacher is telling you what to use.

Since you know the two utility names, have you read their man pages? What have you put into your script to give you the output that you want, because there doesn't appear to be anything there. Unless you write your script to do it, it's not going to...we aren't going to write it for you. Asking over and over for someone to 'fix your code' doesn't appear as if you're putting any effort into your script, but expecting us to do it. You were given advice on debugging things, but didn't respond...you were told about brace expansion, but don't appear to have put effort into a revised script, but instead just keep asking us for it.

If you'd like help, then why don't you post the results of the hints/suggestions you've been given, and show us your updated script?
 
Old 06-01-2020, 09:01 AM   #18
TashiDuks
Member
 
Registered: Sep 2010
Posts: 54

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TB0ne View Post
And we would expect someone with ten years experience and at least four years asking about shell-scripts to know how to write a simple shell script; especially since you've asked about bash scripts and looping before, and even know about shellcheck. And you didn't answer the question about this being homework, because saying what it 'demands' makes it sound like a teacher is telling you what to use.

Since you know the two utility names, have you read their man pages? What have you put into your script to give you the output that you want, because there doesn't appear to be anything there. Unless you write your script to do it, it's not going to...we aren't going to write it for you. Asking over and over for someone to 'fix your code' doesn't appear as if you're putting any effort into your script, but expecting us to do it. You were given advice on debugging things, but didn't respond...you were told about brace expansion, but don't appear to have put effort into a revised script, but instead just keep asking us for it.

If you'd like help, then why don't you post the results of the hints/suggestions you've been given, and show us your updated script?
So does it really bothers you?? whether I am here for 10 years or more.

I think no one is forcing you to answer. if you don't feel like answering just ignore dude. Damn! your soul is full of negativity.

GET WELL SOON BRO!!!
 
Old 06-01-2020, 09:04 AM   #19
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,041

Rep: Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348
Quote:
Originally Posted by TashiDuks View Post
So basically what you mean is, the person who are here in this forum for more than 10 year should be expert?

I would expect some help rather than return questions what has been asked.

Anyways, thanks for keeping track of my account and my knowledge.

Cheers
That is an interesting question. If you did not learn anything in ten years (about it) probably you will not learn anithing in the next 10 years (because it looks like you are not really interested).
Giving "the" complete solution means again you will not learn anything (Is this the help you are waiting for? Why?).

There were a lot of suggestion posted, so you could easily solve it - if you were interested. For example using post #6:
Code:
#!/bin/bash

echo "Enter the range of image you want to download"
read -p "Enter first range of image. log: " StartRange

read -p "Enter Last range of image. log: " EndRange

for i in $(seq $StartRange $EndRange); do
wget -q -P DownloadFolder/  http://localhost/log/log$i.log
done
 
Old 06-01-2020, 09:08 AM   #20
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,041

Rep: Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348Reputation: 7348
if you want to use a forum like this please read the rules.
Quote:
Do not post the same discussion multiple times. Duplicate discussions can be frustrating for other members. Try and pick the most relevant forum for your post. If you are unsure put it in Linux - General.
Quote:
Do not post if you do not have anything constructive to say in the post.
Quote:
By becoming a member you agreed to adhere to these guidelines.
 
3 members found this post helpful.
Old 06-01-2020, 09:10 AM   #21
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,753

Rep: Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983
Quote:
Originally Posted by TashiDuks View Post
So does it really bothers you?? whether I am here for 10 years or more. I think no one is forcing you to answer. if you don't feel like answering just ignore dude. Damn! your soul is full of negativity. GET WELL SOON BRO!!!
This is a very typical answer and response. If it 'bothers you' that we ask you to show your OWN EFFORT in solving your own problem, that says more about you than anyone else. Not sure how it's 'full of negativity' to ask you to show your own effort to solve your own problem. And I am most certainly not your 'bro'.

AGAIN:
  • You know about shellcheck, and have posted about it FOUR YEARS ago. Why haven't you used it?
  • You have at least four years experience writing shell-scripts.
  • You say it 'demands' one of two tools; why?? Is this homework??
  • You know what those tools are; have you read the man pages?
  • You say what output you want; but you haven't done ANYTHING in your script to get it, so how do you expect to get that output?
  • You were given a suggestion on how to debug your script; did you bother to do it? Results were what???
  • You were told about expansion; have you addressed that??
  • Where is your updated script, that shows what you've done/tried based on what you've been told???
Again: have you tried echoing anything to the screen, to see what you're getting for a range???

Last edited by TB0ne; 06-01-2020 at 09:13 AM.
 
Old 06-01-2020, 09:22 AM   #22
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,152
Blog Entries: 6

Rep: Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835
Quote:
For example; if user enters the number 4, then the script should download 4 files randomly.
Code:
for i in {1..4}; do
    echo $((1 + RANDOM % 100))
    sleep 1
done

for i in {1..4}; do 
    echo $RANDOM | cut -c $((${#RANDOM}-6))
    sleep 1
done

for i in {1..4}; do
    shuf -i 1-100 -n 1
    sleep 1
done

for i in {1..4}; do 
    grep -m1 -ao '[0-9]' /dev/urandom | head -n1
    sleep 1
done

for i in {1..4}; do 
    tr -cd 1-99 < /dev/urandom | head -c 2
    sleep 1
done
etc.
 
1 members found this post helpful.
Old 06-01-2020, 09:22 AM   #23
TashiDuks
Member
 
Registered: Sep 2010
Posts: 54

Original Poster
Rep: Reputation: 0
Anyways I got the solution. Thanks to those who gave me straight solution rather than beating the bush around.

BUT I would still say, NO ONE IS FORCING YOU TO ANSWER HERE. IT IS UPTO THE PERSON INTEREST.

Cheers

Last edited by TashiDuks; 06-01-2020 at 09:24 AM.
 
Old 06-01-2020, 09:27 AM   #24
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,753

Rep: Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983
Quote:
Originally Posted by TashiDuks View Post
Oh please. If you cant help others, don't try messing bro. I am not that stupid to re-post same question here. This question is just a example which I currently working.
..which is *NEARLY IDENTICAL* to your other thread, which (amazingly) deals with downloading files via curl/wget in a range of numbers. Again, simple loop, except instead of a range, you just have to iterate through a user-entered count....which you already know how to do. And you were given how to generate a random number in bash.

And again, I am certainly not your 'bro'.
Quote:
your mind is so dirty bro. keep your hands away if you can't help others. no one is forcing you to answer. NO ONE IS LUCKY LIKE YOU!!!!!!!!!!!!!!!!!!
Can I help you? Sure...happy to as soon as you show what effort YOU have put into your own problem. Read the LQ rules and "Question Guidelines"...this isn't the place to come to get your homework done, or have people write scripts for you.

And I am 'lucky', because I actually do my own work.
 
Old 06-01-2020, 09:30 AM   #25
sevendogsbsd
Senior Member
 
Registered: Sep 2017
Distribution: FreeBSD
Posts: 2,252

Rep: Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011Reputation: 1011
so, OP: rather than asking someone how to code something, you have to try it first. What is the point of learning coding without trying? When you try something and then get stuck, you ask for help. If you don't even try, you aren't doing your job.
 
Old 06-01-2020, 09:30 AM   #26
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,753

Rep: Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983
Quote:
Originally Posted by TashiDuks View Post
Anyways I got the solution. Thanks to those who gave me straight solution rather than beating the bush around. BUT I would still say, NO ONE IS FORCING YOU TO ANSWER HERE. IT IS UPTO THE PERSON INTEREST.
Oh?? So why don't you post your solution, so others may benefit??? And asking you to show your own effort isn't 'beating the bush around', but something you should do period.

If you choose to be insulted by people asking you to do your own work, that says more about you than anyone else. Good luck...you'll need it.
 
Old 06-01-2020, 09:37 AM   #27
TashiDuks
Member
 
Registered: Sep 2010
Posts: 54

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TB0ne View Post
Oh?? So why don't you post your solution, so others may benefit??? And asking you to show your own effort isn't 'beating the bush around', but something you should do period.

If you choose to be insulted by people asking you to do your own work, that says more about you than anyone else. Good luck...you'll need it.
Other will definitely be benefited don't worry.
 
Old 06-01-2020, 09:38 AM   #28
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,753

Rep: Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983
Quote:
Originally Posted by sevendogsbsd View Post
so, OP: rather than asking someone how to code something, you have to try it first. What is the point of learning coding without trying? When you try something and then get stuck, you ask for help. If you don't even try, you aren't doing your job.
See the OP's other nearly-identical thread, sevendogsbsd:
https://www.linuxquestions.org/quest...pt-4175676275/
  • Wants the same output
  • Wants to download files via wget or curl
  • Those files have the same names
...but somehow it's not the same question. Only difference is instead of a user-entered range, this one wants a random number for $i. Which if a simple loop is done, you can generate the value upon entry, and just tick up a loop counter..same as ticking up a counter in the other thread.
 
Old 06-01-2020, 09:38 AM   #29
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,753

Rep: Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983Reputation: 7983
Quote:
Originally Posted by TashiDuks View Post
Other will definitely be benefited don't worry.
Great; so again, post your solution.
 
Old 06-01-2020, 09:50 AM   #30
TashiDuks
Member
 
Registered: Sep 2010
Posts: 54

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TB0ne View Post
Great; so again, post your solution.
Just keep eye on this post.
 
  


Reply

Tags
bash, curl, wget



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
Detecting wifi devices within a specified range jalakamkiran Linux - Networking 7 04-16-2020 06:53 AM
Bash script to ping a range or own IP-range ugurgazi Programming 13 05-02-2016 09:08 AM
[SOLVED] bash script reading specified lines from multiple files and concatenating into one TullyGirl Linux - Newbie 6 03-22-2013 10:29 PM
How to list file space usage estimate (du), SPECIFIED BY RANGE tsilok Linux - Newbie 6 10-24-2005 04:56 AM

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

All times are GMT -5. The time now is 10:13 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