0

Note: as pasted in the comment, it is called backtick for the symbol ``, and there's already an answer in: What's the cmd/PowerShell equivalent of back tick on Bash?


Original question:

In bash, people may use reverse quote(``) as result for quoted commands, and integrated in another command.

For example:

cmake -DVAR1=VALUE1 `cat ../custom-options.txt`

where ../custom_options.txt contains many lines like:

-DBUILD_ZLIB=OFF
-DBUILD_TIFF=OFF
-DBUILD_OPENJPEG=OFF
-DBUILD_JASPER=OFF
-DBUILD_JPEG=OFF
-DBUILD_PNG=OFF
-DBUILD_OPENEXR=OFF
-DBUILD_WEBP=OFF
-DBUILD_TBB=OFF
-DBUILD_IPP_IW=OFF
-DBUILD_ITT=OFF
-DWITH_AVFOUNDATION=OFF

For Windows system, it is powershell instead of bash in Linux. My question: what is the equivalent of reverse quote in PowerShell?

ChrisZZ
  • 1,521
  • 2
  • 17
  • 24
  • I think you may be thinking about a script block `{}` – Abraham Zinala Mar 05 '21 at 02:45
  • 3
    FYI, you should use `$( )` instead of the reverse quotes. See http://mywiki.wooledge.org/BashFAQ/082 – Nic3500 Mar 05 '21 at 02:50
  • 2
    It's called a backtick instead of "reverse quote". In powershell you do the same as in bash: `$()`, or maybe even as a plain `()` outside of double quotes – phuclv Mar 05 '21 at 03:16
  • @phuclv Thank you, I didn't know it is called backtick until you mentioned it. The pasted link answers my question. – ChrisZZ Mar 05 '21 at 03:19

0 Answers0