On Tue, Oct 24, 2023 at 08:54:35AM +0100, Tixy wrote: > step=200 > curval=`cat $device/brightness` > newval=`echo $(expr $curval - $step)`
Just FYI, all POSIX compatible shells can do integer arithmetic without calling expr(1). newval=$((curval - step)) Also, assuming "$device/brightness" is a (pseudo-)file containing a textual representation of a number, you can read it with "read" to avoid forking an unnecessary process. read -r curval < "$device/brightness"