I extracted some digits from files using grep
, assuming they are 1 2 3 5 6 11 18
. To get the missings ones in 1..20
, I put them into files and compare using comm
.
a='1 2 3 5 6 11 18'
printf '%d\n' $a | sort -u > 111
printf '%d\n' {1..20} | sort -u > 222
comm 111 222
rm 111 222
which outputs
1
10
11
12
13
14
15
16
17
18
19
2
20
3
4
5
6
7
8
9
Is there more convenient way without saving to files?