Rout

Rout v. i. - To roar; to bellow.

Overview

So what is it?

rout is a simple command-line utility that produces output. As you might guess from the name, it's written in rust.

So what is it?

rout does everything that tools like echo(1) and printf(1) provide, but rout also allows you to do interesting things such as:

So what is it?

It's a tool that can be used to generate a stream of bytes.

So what is it?

It's a thing that displays stuff!

Oh, well why didn't you say?!

Dialog very loosely based on and inspired by the trialogue initiated by "Cat" in the "Red Dwarf" TV series episode "Stasis Leak" (series/season 2, episode 4). If you've never seen this series, make it your life's mission to do so!

Install

bash $ cargo install rout

Examples

```bash

Print "foofoofoo" to stdout, followed by "barbar" to stderr.

$ rout "foo" -r 2 -e "bar" -r 1

Write 50 nul bytes direct to the terminal.

$ rout -t "\0" -r 49

Write continuous stream of nul bytes direct to the terminal,

1 per second.

$ rout -b 1s -t '\0' -r -1

Display a greeting slowly (as a human might type)

$ rout -b 20cs "Hello, $USER.\n"

Display a "spinner" that loops 4 times.

$ rout -b 20cs "\r|\r/\r-\r\\" -r 3

Display all digits between zero and nine with a trailing

newline.

$ rout "{0..9}\n"

Display slowly the lower-case letters of the alphabet,

backwards without a newline.

$ rout -b 1ds "{z..a}"

Display upper-case 'ABC' with newline.

$ rout '\u0041\u0042\u0043\n'

Display 'foo' with newline.

$ rout '\o146\u006f\x6F\n'

Clear the screen.

$ rout '\n' -r $LINES

Write hello to stdout, stderr and the terminal.

$ rout 'hello' -t -r 1 -e -r 1

Display upper-case letters of the alphabet using octal

notation, plus a newline.

$ rout "{\o101..\o132}"

Display 'h.e.l.l.o.' followed by a newline.

$ rout -a . "hello" -a '' "\n"

Display "S.O.S. Please!"

$ rout -a . "SOS" -a '' " Please!\n"

Display upper-case and lower-case letters of the alphabet

including the characters in-between, with a trailing newline.

$ rout "{A..z}\n"

Display lower-case alphabet followed by reversed lower-case alphabet

with the digits zero to nine, then nine to zero on the next line.

$ rout "{a..z}{z..a}\n{0..9}{9..0}\n"

Display lower-case Greek letters of the alphabet.

$ rout "{α..ω}"

Display Cyrillic characters.

$ rout "{Ѐ..ӿ}"

Display all printable ASCII characters using hex range:

$ rout "{x21..x7e}"

Display all printable ASCII characters using 2-byte UTF-8 range:

$ rout "{u0021..u007e}"

Display the entire 2-byte range of UTF-8 characters using aliases:

$ rout "{umin..umax}"

Display all printable ASCII characters using 4-byte UTF-8 range:

$ rout "{U00000021..U0000007e}"

As above, but use more memorable aliases (and less typing ;)

$ rout "{Umin..Umax}"

Display all braille characters.

$ rout "{u2800..u28FF}"

Display 'WARNING' in white on red background.

$ rout '\e[37;41mWARNING\e[0m\n'

Generate 10 random characters.

$ rout '\g' -r 9 ```

History

This is a rust port of the original C implementation, utfout.

FAQ

Appendices

Comparison with utfout

rout is very similar to utfout, but not identical. Here are the major differences: