0

I am trying to get the anaconda version installed and save it in a variable called CONDA_VERSION , I try to do this in bash script using the following:

echo "INFO: getting conda version"
CONDA_VERSION=$(print(conda -V))

but I get this error:

 command substitution: line 9: syntax error near unexpected token `conda'
Mee
  • 1,413
  • 5
  • 24
  • 40
  • remove the inner braces `( )` and `printf` – Jetchisel Sep 03 '21 at 15:06
  • What is `print` here? `conda_version=$(conda -V)` itself suffices. – Charles Duffy Sep 03 '21 at 15:06
  • (all-caps names are used for variables meaningful to the shell itself; variables defined by application code should use lower-case characters by POSIX-specified convention; relevant standard at https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap08.html, should be read keeping in mind that setting a regular shell variable overwrites any like-named environment variable). – Charles Duffy Sep 03 '21 at 15:07

0 Answers0