King's threat to shame Andrew by stripping titles... Monarch made clear he would take 'further action' to remove the prince's honours after disgraced royal tried to dig heels in
NORMAN BAKER: Will the Met give Andrew a free ride (again) or will they do their job and investigate?
Police must launch criminal probe into Prince Andrew's 'dirt digging' bid on Virginia Giuffre, ex-head of Royal Protection demands: Disgraced ex-Duke 'must be quizzed under caution over serious matter'
Double yellow line parking fines soar as drivers blame lack of spaces in busy town centres
Married to a terrorist: Manchester Synagogue killer raped me after I converted to Islam and wed him following my family tragedy, reveals his wife
A414 closed near Chipping Ongar after serious crash
Booker Prize-winning author Ian McEwan pours fury on everyday item we all have in our homes: 'This is a derangement'
Popular TV series returns to Jimmy's Farm with filming underway
Mick Jagger, 82, and fiancée Melanie Hamrick, 38, reunite with the rocker's exes Bianca, 80, and Jerry Hall, 69, at star-studded British Museum Ball
Company that made power systems for servers didn’t know why its own machines ran out of juice
Who, Me? Each new Monday ushers in a week during which you might shine or flatline. The Register celebrates the times you end up doing the latter with a new instalment of Who, Me? It's the column in which you admit to making mistakes and execute cunning escapes.…
Representative Line: The Batch Managing Batch File
Carl was debugging a job management script. The first thing that caught his attention was that the script was called file.bat. They were running on Linux.
The second thing he noticed, was that the script was designed to manage up to 999 jobs, and needed to simply roll job count over once it exceeded 999- that is to say, job 1 comes after job 999.
Despite being called file.bat, it was in fact a Bash script, and thus did have access to the basic mathematical operations bash supports. So while this could have been done via some pretty basic arithmetic in Bash, doing entirely in Bash would have meant not using Awk. And if you know how to use Awk, why would you use anything but Awk?
njobno=`echo $jobno | awk '{if ($0<999) {print $0 + 1} else { print 1 }}'`As Carl writes: "I don't mind the desire to limit job count by way of mod(1000) but what an implementation!"