Skip to main content
Tweeted twitter.com/StackUnix/status/833530057775804416
edited tags
Link
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 265
Source Link

Bash expansion hexadecimal

I would like to know if there is a way of using bash expansion to view all possibilities of combination for a number of digits in hexadecimal. I can expand in binaries

In base 2:

echo {0..1}{0..1}{0..1}

Which gives back:

000 001 010 011 100 101 110 111

In base 10:

echo {0..9}{0..9}

Which gives back:

00  01 02...99

But in hexadecimal:

echo {0..F}

Just repeat:

{0..F}