kernel-source/get_release_number.sh

10 lines
195 B
Bash

#! /bin/sh
prefix=
suffix=
commit=4bf28205
[ -n "$suffix" ] || suffix=$2
while [ "$suffix" != "${suffix#[^0-9]*.}" ]; do
suffix=${suffix#[^0-9]*.}
done
echo $prefix$suffix${commit:+_}$commit