lkml.org 
[lkml]   [2022]   [Sep]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH 05/15] kbuild: build init/built-in.a just once
Date
...
> > +VERSION=$(cat .version) 2>/dev/null &&
> > +VERSION=$(expr $VERSION + 1) 2>/dev/null ||
> > +VERSION=1

What's wrong with:
VERSION=$(($(cat .version 2>/dev/null) + 1))

If you are worried about .version not containing a valid
number and $((...)) failing then use ${VERSION:-1} later.

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

\
 
 \ /
  Last update: 2022-09-14 11:47    [W:0.078 / U:1.560 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site