Bash Color

Intro Bash์—์„œ Color๋ฅผ ํ‘œํ˜„ํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์•Œ์•„๋ณธ๋‹ค. bash๋กœ ์ž‘์„ฑํ•œ ํ”„๋กœ๊ทธ๋žจ์˜ ์ถœ๋ ฅ์ด๋‚˜ ํ”„๋กฌํ”„ํŠธ๋ฅผ ์˜ˆ์˜๊ฒŒ ํ‘œํ˜„ํ•ด ๋ณด์ž. ๊ทธ๋Ÿฌ๋‚˜ ์ง€๋‚˜์นœ ์‹œ๊ฐ„ ํˆฌ์ž ๋ณด๋‹ค๋Š” ์ƒ‰๊น”์ด ์ฃผ๋Š” ์ฃผ๋ชฉ์„ฑ๊ณผ ๊ตฌ๋ถ„๋ ฅ, ํŽธํ•œํ•จ, ๊ฐ„๊ฒฐํ•จ์— ์ง‘์ค‘ํ•˜์ž. Map the colors # Color mapping grey='\[\033[1;30m\]' red='\[\033[0;31m\]' RED='\[\033[1;31m\]' green='\[\033[0;32m\]' GREEN='\[\033[1;32m\]' yellow='\[\033[0;33m\]' YELLOW='\[\033[1;33m\]' purple='\[\033[0;35m\]' PURPLE='\[\033[1;35m\]' white='\[\033[0;37m\]' WHITE='\[\033[1;37m\]' blue='\[\033[0;34m\]' BLUE='\[\033[1;34m\]' cyan='\[\033[0;36m\]' CYAN='\[\033[1;36m\]' NC='\[\033[0m\]' Bash Prompt ~/.bash_profile์ด๋‚˜ ~/.bashrc์— ๋‹ค์Œ๊ณผ ๊ฐ™์ด ์ž‘์„ฑํ•˜๊ณ  ๋‹ค์‹œ ๋กœ๊ทธ์ธ case $HOSTNAME in plato*) PSC="\e[1;33m" ;; *) PSC="\e[36m" ;; esac PS1="[\j]\[${PSC}\]\u@\h(\l) \[\e[37m\][ \w ]\[\e[00m\]\n\[\e[1m\]\#\[\e[0m\] \$ " REFERENCE Bash Prompt Generator : https://robotmoon.com/bash-prompt-generator/ Customizing Bash Prompt : https://linuxopsys.com/topics/customizing-bash-prompt-in-linux-changing-colors

2023-08-10 ยท 84 words

bash-it

๋‹ค์Œ ๋งํฌ ์ฐธ์กฐ https://www.linuxfordevices.com/tutorials/linux/fancify-bash-terminal-with-bash-it

2022-08-26 ยท 4 words

Bash

Tools, Functions bash it : zsh์ฒ˜๋Ÿผ ์ด์˜๊ฒŒ, ๋‹ค์–‘ํ•œ ๊ธฐ๋Šฅ์œผ๋กœ ๊พธ๋ฏธ๊ธฐ bash color : ํ„ฐ๋ฏธ๋„ ์ปฌ๋Ÿฌ ์ถœ๋ ฅ ๋ฐ ์ œ์–ด Bash Programming bash read lines : ํŒŒ์ผ์—์„œ ํ•œ ์ค„์”ฉ ๋ผ์ธ์„ ์ฝ์–ด ์˜ค๊ธฐ Links bash config files https://floatingoctothorpe.uk/2018/bash-config-and-where-it-lives.html

2022-08-26 ยท 35 words

Bash readlines how to

Method 1 for read -r line do echo $line done < input_file.txt > out_file.txt Method 1 file=$(cat input_file.txt) for line in $file do echo $line done < input_file.txt > out_file.txt Links https://www.geeksforgeeks.org/bash-scripting-how-to-read-a-file-line-by-line/

2022-08-26 ยท 32 words