1

I downloaded the CLI Client habash for the habit/routine gameification project habatica.com. In the fandom wiki for habash it is written that, I need to set environment variables. Additonally I want to make the program habash an ordinary CLI-program, so that I dont have to invoke it via the fullpath. I describe now, what I have been doing. I did the following.

  • After declare -x HABITICA_UUID=[myUserID] I did not find any entries in ~/.bashrc. Any one knows why?
  • Therfore I added HABITICA_UUID and HABITICA_TOKEN at the top of ~/.bashrc (and made a comment for myself)
  • chmod 600 ~/.bashrc because UUID and TOKEN are regarded as PWs.
  • sudo mv ./habash /opt
  • sudo ln -s /opt/habash/habash /usr/local/bin

Is this the best way how to do it? (storing in /opt and linkint to /usr/local/bin ; variables in .bashrc and chmoding it with 600)

1 Answer 1

2
  • After declare -x HABITICA_UUID=[myUserID] I did not find any entries in ~/.bashrc. Any one knows why?

You need to put it in a config file e.g. ~/.bashrc. Setting it on command line, only has effect on the current shell.

  • Therfore I added HABITICA_UUID and HABITICA_TOKEN at the top of ~/.bashrc (and made a comment for myself)
  • chmod 600 ~/.bashrc because UUID and TOKEN are regarded as PWs.

You could but it in a new custom file, chmod this file, and add a line to source this file from ~/.bashrc

in ~/.bashrc (better to also add code to check that file is readable)

. ~/.my_custom_config
  • sudo mv ./habash /opt
  • sudo ln -s /opt/habash/habash /usr/local/bin

Best not to mix /opt and /usr/local. They have different structures.

Look in to stow. You will then put each app into /usr/local/stow/app-name, and use stow to link it into /usr/local/{bin,lib,share,var,etc}

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.