#!/bin/sh # nextuid: find the next available userid. cut -f3 -d: /etc/passwd | sort -n | awk 'BEGIN { prev = 0 } { np = prev + 1 if ($1 > 100 && $1 != np) { print np exit } prev = $1 }' exit 0