Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1086419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:48:38+00:00 2026-05-16T22:48:38+00:00

$ cat fav #!/bin/bash for i in {1..7} do echo http://api.stackoverflow.com/1.0/users/113124/favorites?page=$i&pagesize=100 done $ ./fav

  • 0
$ cat fav
#!/bin/bash
for i in {1..7}
do
    echo http://api.stackoverflow.com/1.0/users/113124/favorites?page=$i&pagesize=100 
done
$ ./fav
http://api.stackoverflow.com/1.0/users/113124/favorites?page=1
http://api.stackoverflow.com/1.0/users/113124/favorites?page=3
http://api.stackoverflow.com/1.0/users/113124/favorites?page=6
http://api.stackoverflow.com/1.0/users/113124/favorites?page=5
http://api.stackoverflow.com/1.0/users/113124/favorites?page=7
http://api.stackoverflow.com/1.0/users/113124/favorites?page=4
http://api.stackoverflow.com/1.0/users/113124/favorites?page=2
$
  • Why don’t I get &pagesize=100 at the end?
  • Also, why are the results out of order?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T22:48:40+00:00Added an answer on May 16, 2026 at 10:48 pm

    & runs a program in the background, and it’s also an “end of command” indicator just like ;, which is why your command is cut short. You can escape it with \ or put the whole thing in double quotes:

    echo http://api.stackoverflow.com/1.0/users/113124/favorites?page=$i\&pagesize=100
    echo "http://api.stackoverflow.com/1.0/users/113124/favorites?page=$i&pagesize=100"
    

    Interestingly, pagesize=100 was also being executed as a separate command, but that is actually a valid variable assignment. So it wasn’t generating an error message which might have clued you in to what was happening.

    The backgrounding means all of the echo statements were executed in parallel. That explains why they ended up being executed in random order since the seven processes will finish in an indeterministic order based on when they get time slices from the kernel.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

bash-3.00$ cat arr.bash #!/bin/bash declare -a myarray myarray[2]=two myarray[5]=five echo ${#myarray[*]} echo ${#myarray[@]} bash-3.00$
$ cat fromhere.sh #!/bin/bash FROMHERE=10 for i in $(seq $FROMHERE 1) do echo $i
$ cat read.sh #!bin/bash // how can I read the columnwise data to awk-script?
$ cat downloaded_file.html 1373 <A HREF=http://site.com/STDMON11202010_company.txt>STDMON11202010_company.txt</A><br> Monday, November 22, 2010 1:31 AM How do
In this example com.test.Cat extends com.test.Animal and there is no field DB in CAT
$ cat isbndb.sample | wc -l 13 $ var=$(cat isbndb.sample); echo $var | wc
I have the following html: <div id=cats-and-links> <div class=cat favorites> <h2>Favorites</h2> <ul class=ui-sortable> <li
cat a.txt | xargs -I % echo % In the example above, xargs takes
The cat that is on this web page is suppose to move when you
I have the following script: cat > /tmp/script.sh <<EndOfScript #!/bin/sh ulimit -n 8192 run_app

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.