Creates "human-made-like" asciinema ascii-casts out of the provided regular text file as if we would type it!
The input file can use the following special characters:
- ±: Line that contains prompt.
- §: Output of commands.
- &: Clears screen (if it is the only character in the line)
- ~: Wait a few seconds (if it is the only character in the line)
The following command adds the special character §
in all lines that do not start with ±
(display at once all non prompt lines).
sed -i '/^±/!s/^/§/' input.txt
You can also do it for lines that do not have on character only (i.e., skip "clear screen" or "wait a few second" characters).
sed -i '/^±/!s/^.\\{2,\\}/§/' input.txt
The following command adds the special character ±
at the beginning of all lines that contain character $
(there is a prompt).
sed -i '/\$/s/^/±/' input.txt