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, thenservera
-
Confirm neither variable is set
The brackets make an empty value visible.
echo "PAGER=[$PAGER]" echo "EDITOR=[$EDITOR]" -
Export PAGER
First see the default. Press q to leave
less.man lsThen take the pager out of the way.
export PAGER=cat man ls -
Install nano and export EDITOR
nanois not installed by default, so add it first.sudo dnf install -y nanocrontab -easksEDITORwhich program to open. With nothing set you getvi. Quit without saving using :q!.crontab -eNow set
EDITORand run the same command. A completely different editor opens. Leavenanowith Ctrl + X.export EDITOR=nano crontab -e -
Confirm both are gone in a new session
exportcopies 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]"