How to have a custom bash prompt that changes when you are in a certain folder.

This is how to create a custom bash prompt that will change if the user is in a certain folder, but is standard anywhere else. PS1="┌─╼ \$(if [[ \$PWD/ = \$HOME/anime/* ]]; then \ echo \"\[\e[1;35m\](\[\e[0;35m\] •\[\e[1;35m\]^ ω ^) \[\e[1;34m\]\$(pwd | sed ‘s|’$HOME/anime/’|アニメ |; s|’$HOME/anime’|アニメ |’)\[\e[0m\]\" \ ; else \…

Read More

How to include code inside a loop in C.

This loop I wrote in C enables if statements inside a loop. This could be a useful thing to know. #include <stdio.h>   int main(void) { int k;   for (k = 0; k < 16; k++) { printf("* *\n"); if (k == 4 || k == 12) { printf("\n\t\t-\n");…

Read More