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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T08:17:59+00:00 2026-05-17T08:17:59+00:00

There are two different syntaxes for command substitution, FOO=$(echo bar) and FOO=`echo bar` As

  • 0

There are two different syntaxes for command substitution,

FOO=$(echo bar)

and

FOO=`echo bar`

As far as I know, the first method is defined in Bash, while the second is defined in sh.

Consider the following use of command substitution in an sh script.

#!/bin/sh
FOO=$(echo bar)

Does that fall under the definition of bashism?

bashisms, i.e. features not defined by
POSIX (won’t work in dash, or general
/bin/sh).

  • 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-17T08:17:59+00:00Added an answer on May 17, 2026 at 8:17 am

    It’s the same thing. So no it’s not a bashism nor related to bash only.

    Command Substitution
    Command substitution allows the output of a command to be substituted in place of the command name itself. Command substitution occurs when the command is enclosed as follows:

    $(command)
    

    or ( ”backquoted” version):

    `command`
    

    The shell expands the command substitution by executing command in a subshell environment and replacing the command substitution with the standard output of the command, removing sequences of one or more newlines at the end of the substitution. (Embedded newlines before the end of the output are not removed; however, during field splitting, they may be translated into spaces, depending on the value of IFS and quoting that is in effect.)


    Resources :

    • man dash
    • The Open Group Base Specifications – Shell Command Language thanks to @Ned Deily for this good resource 🙂
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There are two different ideas about the element which plays role of default command
I'd like to know the difference between this two syntaxes: return db.Contacts.First(x => x.ContactID
I'd like to know the reasoning why there are two different classes used, instead
I'd like to know the reasoning why there are two different classes used, instead
HI I like to know why there are two Date classes in two different
In Visual Basic 2008, there's two different ways that I know of to accomplish
There's two different syntaxes in the example below. One works and the other does
I'm just discovering log4cxx logging framework. It seems there are two different syntaxes for
As you may know there are two different kinds of regular expressions implementations: one
I found there're two different opinions about how greedy regex is executed: one is,

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.