If you found this project helpful or enjoyed using it, please consider giving it a star!
no is the opposite of yes.
It behaves similarly to the Unix yes command, but:
- Defaults to printing
ninfinitely if no arguments are provided.
--times, -t: Limits repetitions (e.g.,-t 5prints 5 times).--interval, -i: Adds a fixed delay (in seconds) between each output.--jitter, -j: Adds a random delay (0 to N seconds) on top of the interval.--output, -o: Writes the output to one or multiple specified files, streams, or devices.--command, -cmd: Repeatedly executes a shell command and captures its output for each iteration.--random, -r: Picks a random string from a comma-separated list or template for each iteration.--skip: Ignores the first N items of a sequence, repetition, or template.--version, -v: Displays metadata or internal state information.--help, -h: Displays the help manual and usage instructions.--unique: Ensures every output of no is unique.
--seq: Generates numeric (e.g.,1:10) or character (e.g.,a:z) sequences.--step: Sets the increment/decrement value (supports decimals like0.5).--cycle: Repeats sequences infinitely (requires a limit via-t).--pad: Zero-pads numeric output to a specific length (e.g.,--pad 3becomes001).--precision: Sets fixed decimal places for floating-point numeric output.--calc: Performs arithmetic operations on numeric output (e.g.,'+5','*2').
--format, -f: Applies a custom printf-style string (e.g.,-f "ID-%s").--case: Transforms text case usingupper,lower, orswap.--color / --style: Wraps output in ANSI color codes; supports named colors, hex codes, or style combinations (bold,underline,italic).--header: Prints a single designated line once before the main process begins.--prefix: Adds a specific string before every output item.--suffix: Adds a specific string after every output item.--width: Right-aligns the output to a fixed character width.--trim: Removes leading/trailing whitespace from output items.
-cols: Arranges the output into N columns using tabbed spacing.--separator, -s: Defines custom delimiters between items (defaults to\n).--count, -c: Prepends an incrementing line counter (e.g.,1: text).--template: Uses content from a file or string as the source text.--filter: Outputs only items matching a specified regular expression.--: Stops parsing flags; everything following is treated as literal text.--verify: Runs an internal suite of self-tests to ensure all logic functions correctly.
For practical examples and ways to use no, see the Use Cases page.
$ no
n
n
n
...
$ no i hate mustard
i hate mustard
i hate mustard
...
# You can pass (multiple) arguments
$ no --example string --example2 string2 "output"The table below compares the no script with other common Unix utilities that generate repeated or sequential output.
| Feature | no | yes | jot | seq | shuf |
|---|---|---|---|---|---|
| Infinite repetition | ✅ | ✅ | ❌ | ❌ | ❌ |
| Repetition count | ✅ | ❌ | ✅ | ✅ | ✅ |
| Custom string output | ✅ | ✅ | ❌ | ✅ | ✅ |
| Numeric sequence generation | ✅ | ❌ | ✅ | ✅ | ❌ |
| Character sequence generation | ✅ | ❌ | ✅ | ✅ | ❌ |
| Step/increment support | ✅ | ❌ | ✅ | ✅ | ❌ |
| Zero-padding | ✅ | ❌ | ✅ | ✅ | ❌ |
| Decimal precision formatting | ✅ | ❌ | ✅ | ✅ | ❌ |
| Random selection from list | ✅ | ❌ | ❌ | ❌ | ✅ |
| Execute command repeatedly | ✅ | ❌ | ❌ | ❌ | ❌ |
| Interval/delay between outputs | ✅ | ❌ | ❌ | ❌ | ❌ |
| Columns/custom separator | ✅ | ❌ | ✅ | ❌ | ❌ |
| Supports negative step | ✅ | ❌ | ✅ | ✅ | ❌ |
| Alphabetical ranges(a..z) | ✅ | ❌ | ✅ | ✅ | ❌ |
| Can repeat random items N times | ✅ | ❌ | ❌ | ❌ | ✅ |
| Random Jitter Delay | ✅ | ❌ | ❌ | ❌ | ❌ |
| Case(Upper/Lower/Swap) | ✅ | ❌ | ❌ | ❌ | ❌ |
| ANSI Color Support | ✅ | ❌ | ❌ | ❌ | ❌ |
| CSV/File Header Support | ✅ | ❌ | ❌ | ❌ | ❌ |
| Sequence Cycling | ✅ | ❌ | ❌ | ❌ | ❌ |
| Skip N Items | ✅ | ❌ | ❌ | ❌ | ❌ |
| Standard--flag=val Parsing | ✅ | ❌ | ❌ | ❌ | ❌ |
| Lightweight | ✅ | ✅ | ✅ | ✅ | ✅ |
Step 1: Download the install script using fetch
fetch -o install.sh https://raw.githubusercontent.com/ihatemustard/no/refs/heads/main/install.shStep 2: Make the script executable
chmod +x install.shStep 3: Run the script as root (using doas or sudo)
./install.sh- Installs the command to
/usr/local/bin/no
To remove no, run the same script (also as root).
Step 1: Download the no script
Step 2: Make it executable
chmod +x no.shStep 3: Move it to a directory in your PATH (requires root)
sudo mv no.sh /usr/local/bin/noStep 4: Test it
no -hTo remove no, run:
sudo rm /usr/local/bin/noInstall no minimal (Not recommended)
Step 1: Download the no minimal script
Step 2: Complete all the steps listed above.
sh(POSIX-compliant shell, usually/bin/sh)awk,printf,od(for random logic)
- Add Features from jot(1)
- TUI Installer
- Include help instead of using
man - Install through Wi-Fi and not locally in Installer
- Add Version Flag
- Add Count Flag
- Fix
--commandand--seperatorflags - Make parsing better
- Add
--filter(filter or modify output) - Support multiple targets with
--output - Add simple arithmetic operations
- Add improved ANSI Styling (Bold, underline, hex)
- Multi-line templates /
--templatesupport - Update Use Cases page to latest
- Add flag
--unique: Ensures every output of no is unique. - Add flag
--trim: Removes leading/trailing whitespace from output items.
