Exercise

Changing the Pager and Editor Exercise

Task

Tell every program you run which pager and which editor you want, instead of accepting each program's default.

Hosts
workstation, then servera
  1. Confirm neither variable is set

    The brackets make an empty value visible.

    echo "PAGER=[$PAGER]"
    echo "EDITOR=[$EDITOR]"
  2. Export PAGER

    First see the default. Press q to leave less.

    man ls

    Then take the pager out of the way.

    export PAGER=cat
    man ls
  3. Install nano and export EDITOR

    nano is not installed by default, so add it first.

    sudo dnf install -y nano

    crontab -e asks EDITOR which program to open. With nothing set you get vi. Quit without saving using :q!.

    crontab -e

    Now set EDITOR and run the same command. A completely different editor opens. Leave nano with Ctrl + X.

    export EDITOR=nano
    crontab -e
  4. Confirm both are gone in a new session

    export copies a variable into the programs you launch. It does not write it to a file, so the new session starts without it.

    exit
    ssh servera
    echo "PAGER=[$PAGER]"
    echo "EDITOR=[$EDITOR]"