Shell script programming (strict terminal format control, beautiful output font color), shell script Programming
#! /Bin/bash # font output color and terminal format control # font color 30-37echo-e "\ 033 [30 m black character \ 033 [0 m" echo-e "\ 033 [31 m red word \ 033
Many users will find that the script font is not found in the list of fonts in the Word2003 or Word2000 document window after a new installation of Word2003 or Word2000 in a Windows XP system. If you encounter this situation, you can not rush to download the official script font or copy the official
Shell script programming (strict terminal format control, beautiful output font color)
#! /Bin/bash # font output color and terminal format control # font color 30-37echo-e "\ 033 [30 m black character \ 033 [0 m" echo-e "\ 033 [31 m red word \ 033 [0 m "echo-e" \ 033 [32 m green word \ 033 [0 m "echo-e" \ 033 [33m yel
How to determine the number of input parameters in a shell script submission: Junjie font: [Increase decrease] type: Reprint
This article mainly introduces the method of judging the number of input parameters in shell script, using the built-in variable $ #即可实现判断输入了多少个参数, the friend you need can refer to the following
$ #代表了命令行的参数数量, you can see the following e
Shell script (strict terminal format control, beautiful output font color)[Cpp] view plaincopy
#! /Bin/bash
#
# The following figure shows the font output color and terminal format control.
# Font color 30-37
Echo-e "\ 033 [30 m black character \ 033 [0 m"
Echo-e "\ 033 [31 m red \ 033 [0 m"
Echo-e "\ 033 [32 m
We usually need to output a color font when we write a script, and now we can pass it. Color.sh to introduce this script directly, using the variables inside, so that we can reduce the amount of time we normally write scripts#颜色变量脚本展示[[emailprotected]opt]#catcolor.sh#!/bin/bash# Word color variable black= "\033[30m" #黑色RED = "\033[31m" #红色GREEN = "\033[32m"
n rows #\033[nb cursor down n rows echo-e "\033[4a cursor up 4 lines \033[0m" #\033[nc cursor right shift n rows #\033[ nd cursor left n line #\033[y;xh set cursor position #\033[2j Clear Screen #\033[k clear the contents from cursor to end of line ECHO-E "\033[k clear cursor to end of line \033[0m" #\033[s save cursor position #\033[u restore cursor position # \033[?25| Hide cursor #\033[?25h display cursor ECHO-E "\033[?25l hide cursor \033[0m" ECHO-E "\033[?25h show cursor \033[0m "#下面的这个例子是
\33[7mReverse Display \33[8mBlanking \33[30m—\33[37mSet foreground color \33[40m—\33[47mSet Background color \33[naMove Cursor upNYes \33[NBMove Cursor DownNYes \33[NCMove Cursor RightNYes \33[ndMove Cursor LeftNYes \33[y;xhSet cursor position \33[2jClear Screen \33[kClears the contents from the cursor to the end of the line \33[sSave Cursor position \33[uRestore cursor Position \33[?25lHide cursor \33[?25hDisplay cursor\e[--The starting position of
cursor up 4 lines \033[0m"
#\033[nc cursor right shifts n rows
#\033[nd cursor left n rows
#\033[y;xh Setting the cursor position
#\033[2j Clear Screen
#\033[k clears the contents from the cursor to the end of the line
Echo-e "\033[k clear the cursor to the end of the line \033[0m"
#\033[s Save Cursor position
#\033[u Restore cursor Position
#\033[?25| Hide Cursor
#\033[?25h Display cursor
ECHO-E "\033[?25l hidden cursor \033[0m"
ECHO-E "\033[?25h display cur
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.