Welcome to the Linux Foundation Forum!

Lesson 3 - User Environment

In Setting Environment Variables:


$ vi .bashrc <-- added "export MYVAR=myvalue"

Is this an error?, It should be echo 'MYVAR=myvalue' >> .bashrc?


  • coop
    coop Posts: 904
    edited December 2022

    the "<-- .." is a comment. Perhaps it would have been better to say "edit .bashrc to include the statement 'export MYVAR=myvalue' " and never mention "vi". You read the line too literally. It doesn't matter if you use vi, emacs, nano etc, as long as you include the line and start a fresh bash to make sure it is read in. Indeed another method of editing would be the >> command you show. :)

  • ajra
    ajra Posts: 6

    Maybe it's just a typo because the comment in the shell it's #

  • coop
    coop Posts: 904

    it's not a typo. It is just something on the printed page pointing to something else, not intended to be interpreted as a command or output. Perhaps poorly phrased as it confused you.


Upcoming Training