liveBook · Manning

Shell command history

As explained in Build Your Own Robot: Using Python, CRICKIT, and Raspberry Pi

A shell feature that stores previously entered commands so they can be retrieved and executed again.

Shell command history stores previously entered commands for retrieval and execution. In a robot shell, the up and down keys revisit commands and can replay earlier movements. section 4.2

A basic shell keeps history only during the current session. Persistent history requires loading a history file at startup and saving it when the shell exits; Python's readline module supplies these operations. section 4.8

Replayable robot movements

A recorded sequence can contain commands such as spin_right, forward 0.2 1, and backward 0.5. Recalling these entries makes repeated movement testing quick and direct. section 4.2 section 4.8

spin_right
spin_left
right
left
forward 0.2 1
forward 0.2 3
backward 0.5 1
backward 0.5

Inspect a compact movement history containing turns, speed and duration arguments, and forward and backward commands. section 4.8

How Build Your Own Robot: Using Python, CRICKIT, and Raspberry Pi covers it

How deep it goes
Explains interactive recall and persistent storage, then identifies readline hooks for loading and saving history without implementing them fully.
Examples
Uses up and down recall, movement commands, recorded command files, and a Python history file.
What it assumes
Assumes familiarity with Python and Bash REPL interaction while introducing history persistence for a custom robot shell.
What you can do after
Operate a robot shell by recalling commands interactively and configure persistent history with readline.
How it connects
Connects command history with REPLs, robot shells, readline, command-line arguments, Python, and Bash.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build Your Own Robot: Using Python, CRICKIT, and Raspberry Pi. The section links point to the parts of the book it draws on.