Visit Our UNIX and Linux User Community

Search Results

Search: Posts Made By: MadeInGermany
Forum: OS X (Apple) 01-20-2020
5,688
Posted By MadeInGermany
I see. Here is how to strip leading zeros with...
I see. Here is how to strip leading zeros with Posix-shell-builtins:
num=${TEST_VAL#??}
lz=${num%%[1-9]*}
TEST_VAL=${num#$lz}
Don't know if this is really faster than expr.
Forum: OS X (Apple) 01-19-2020
5,688
Posted By MadeInGermany
Better replace all expr with arithmetics by the...
Better replace all expr with arithmetics by the builtin=faster $(( ))
SEED1=$(( ${SEED1} + 1 ))
TEST_VAL=$(( 0${TEST_VAL#??} ))
Showing results 1 to 2 of 2

 

Featured Tech Videos

All times are GMT -4. The time now is 11:47 PM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy