File tree Expand file tree Collapse file tree 3 files changed +14
-18
lines changed Expand file tree Collapse file tree 3 files changed +14
-18
lines changed Original file line number Diff line number Diff line change @@ -13,9 +13,7 @@ copy() {
1313 case " ` uname` " in
1414 Darwin* )
1515 pbcopy ;;
16- CYGWIN* )
17- clip ;;
18- MINGW* )
16+ CYGWIN* |MINGW* )
1917 clip ;;
2018 * )
2119 xsel -b ;;
Original file line number Diff line number Diff line change 11#! /bin/bash
22# @Function
33# show all console text color themes.
4+ #
5+ # @online-doc https://github.com/oldratlee/useful-scripts/blob/master/docs/shell.md#beer-console-text-color-themessh
6+ # @author Jerry Lee (oldratlee at gmail dot com)
47
58readonly _ctct_PROG=" $( basename " $( readlink -f " $0 " ) " ) "
69[ " $_ctct_PROG " == ' console-text-color-themes.sh' ] && readonly _ctct_is_direct_run=true
Original file line number Diff line number Diff line change 11#! /bin/bash
2+ # @Function
3+ # print arguments in human and debug friendly style.
4+ #
5+ # @online-doc https://github.com/oldratlee/useful-scripts/blob/master/docs/shell.md#beer-echo-argssh
6+ # @author Jerry Lee (oldratlee at gmail dot com)
27
3- readonly ec =$' \033 ' # escape char
8+ readonly ebegin =$' \033 [1;31m ' # escape begin, red color
49readonly eend=$' \033 [0m' # escape end
510
6- redEcho () {
7- if [ -c /dev/stdout ] ; then
8- # if stdout is console, turn on color output.
9- echo -n " $ec [1;31m$@ $eend "
10- else
11- echo -n " $@ "
12- fi
13- }
14-
1511echoArg () {
1612 local index=$1
1713 local count=$2
1814 local value=$3
1915
20- echo -n " $index /$count : "
21- redEcho " ["
22- echo -n " $value "
23- redEcho " ]"
24- echo
16+ # if stdout is console, turn on color output.
17+ [ -c /dev/stdout ] &&
18+ echo " $index /$count : $ebegin [$eend$value$ebegin ]$eend " ||
19+ echo " $index /$count : [$value ]"
2520}
2621
2722
You can’t perform that action at this time.
0 commit comments