Better HN
topnewbestaskshowjobs
Log inSign up

mklm

5 karma · joined Apr 9, 2014 (12y ago) · 3 submissions

Submissions

1.

YouTube demonetizes youtubers covering the war(youtube.com ↗)

6 points · by mklm · 4y ago · discuss

comment 7y ago · link · parent

Although -w is supported by both GNU and BSD versions of `seq', BSD's ignores leading zeros in input. Thus a more portable approach is:

  comm -1 -3 <(ls *_A.csv | sed 's/_.*$//') <(seq -f %04.f 500) | sed 's/^0*//'

comment 7y ago · link · parent

If you don't mind "cd dataset-directory" beforehand, a shorter and possibly more correct version would be:

  comm -1 -3 <(ls *_A.csv | sed 's/_.*$//') <(seq -w 0500) | sed 's/^0*//'
The OP's solution doesn't seem correct because of the different ordering of the two inputs of `comm': lexicographical (ls) and numeric (seq).