Skip to content

Instantly share code, notes, and snippets.

@dblevins
Created February 2, 2015 06:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dblevins/27ac69986b694712cd74 to your computer and use it in GitHub Desktop.
Save dblevins/27ac69986b694712cd74 to your computer and use it in GitHub Desktop.
#!/bin/bash
cat > /tmp/termcolors.java <<EOF
public class termcolors {
public static void main(String[] args) {
for (int i = 0; i < 256; i++) {
System.out.printf("\033[38;5;%sm#@%03d", i, i);
System.out.print(" ");
if (i % 12 == 0) System.out.println();
}
System.out.println();
}
}
EOF
javac /tmp/termcolors.java &&
java -cp /tmp termcolors
cat <<EOF
#!/bin/bash
N=202
echo -e "\033[38;5;\${N}mTry Me\033[0m"
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment