random script dump
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011
  1. #!/usr/bin/env perl
  2. # taken from https://github.com/iraquitan/custom-scripts/blob/master/simpler.sh
  3. use open ':std', ':encoding(UTF-8)';
  4. my $block = shift || (chr(0x2588) x 3);
  5. for (["", 0], ["1;", 0], ["", 8], ["1;", 8]) {
  6. my ($bold, $offset) = @$_;
  7. my @range = map $offset + $_, 0..7;
  8. printf "%s %-6s ", $bold ? "bold" : "norm", "$range[0]-$range[-1]";
  9. print map("\e[${bold}38;5;${_}m$block", @range), "\e[0m";
  10. print "\n"
  11. }