Welcome to the Linux Foundation Forum!

Lesson 3 - User Environment

Options

In Setting Environment Variables:

the:

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

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

Comments

  • coop
    coop Posts: 915
    edited December 2022
    Options

    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: 7
    Options

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

  • coop
    coop Posts: 915
    Options

    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.

Categories

Upcoming Training