Как насчет этого?
range() {
# increment
incr=$1
# input
input=$2
# mathematically, min = floor( input/incr )*incr
# then max = min+incr-1
# but `floor' isn't necessary in bash because it uses integer division
min=$(( input/incr*incr ))
max=$(( min+incr-1 ))
echo $min $max
}
Затем:
$ range 32 15
0 31
$ range 32 35
32 63
Со страницы руководства:
--color[=WHEN]
colorize the output; WHEN can be 'always' (default if
omitted), 'auto', or 'never'; more info below
Чтобы сделать это поведением по умолчанию, просто создайте псевдоним.
alias ls="ls --color=auto"