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 560075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:18:17+00:00 2026-05-13T12:18:17+00:00

What do the two ampersands in the following command do: (make foo&)&

  • 0

What do the two ampersands in the following command do:

(make foo&)&
  • 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-13T12:18:17+00:00Added an answer on May 13, 2026 at 12:18 pm

    The ( and ) run the command in a subshell. This means that a separate shell is spawned off and the command is run. This is probably because they wanted to use shell specific operation (backgrounding – other examples are redirection etc.). The first & in the command backgrounds the command run in the subshell (ie. make foo). The second ampersand backgrounds the subshell itself so that you get back your command prompt immediately.

    You can see the effects here

    Foreground on the current shell

    (bb-python2.6)noufal@NibrahimT61% ls # shell waits for process to complete
    a  b  c  d  e
    

    Background on the current shell

    (bb-python2.6)noufal@NibrahimT61% ls& #Shell returns immediately.
    [1] 3801
    a  b  c  d  e
    [1]  + done       /bin/ls -h -p --color=auto -X
    

    Using a subshell (Foreground)

    (bb-python2.6)noufal@NibrahimT61% (ls&) # Current shell waits for subshell to finish.
    a  b  c  d  e                           
    

    In this case, the current shell waits for the subshell to finish even though the job in the subshell itself is backgrounded.

    Using a subshell (BAckground)

    (bb-python2.6)-130- noufal@NibrahimT61% (ls &)&
    [1] 3829
    a  b  c  d  e
    [1]  + exit 130   (; /bin/ls -h -p --color=auto -X &; )
    

    The foreground shell returns immediately (Doesn’t wait for the subshell which itself doesn’t wait for the ls to finish). Observe the difference the command executed.


    A sidenote on the need to run some commands in a subshell. Suppose you wanted to run a “shell command” (ie. One that uses shell specific stuff like redirects, job ids etc.), you’d have to either run that command in a subshell (using (, )) or using the -c option to shells like bash. You can’t just directly exec such things because the shell is necessary to process the job id or whatever. Ampersanding that will have the subshell return immediately. The second ampersand in your code looks (like the other answer suggests) redundant. A case of “make sure that it’s backgrounded”.

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

Sidebar

Ask A Question

Stats

  • Questions 376k
  • Answers 376k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Maybe there's some kind of conversion problem. Try use var_dump($this->totplpremium);… May 14, 2026 at 8:32 pm
  • Editorial Team
    Editorial Team added an answer Like @Steward suspected, it's not valid. Formally it's effectively causing… May 14, 2026 at 8:32 pm
  • Editorial Team
    Editorial Team added an answer I would recommend the following steps: If you haven't already… May 14, 2026 at 8:32 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.