Hot answers tagged

1

Use the -u switch to only output the unique values. who | cut -d " " -f 1 | sort | uniq -u You need to sort the usernames, though, as uniq expects the input to be sorted. That's true for the -d solution, too, unless your version of who already groups the lines by user (and the one I have accessible (GNU 8.28) doesn't).


1

You need something like this: res=`realm join -U admin $domain_name 2>&1` if [[ $res == *"realm: Already joined to this domain"* ]]; then echo done exit 0 fi


1

$ echo hello | iconv -f ascii -t utf-16le | hexdump -C 00000000 68 00 65 00 6c 00 6c 00 6f 00 0a 00 |h.e.l.l.o...| $ echo hello | iconv -f ascii -t utf-16le | od -t x1 0000000 68 00 65 00 6c 00 6c 00 6f 00 0a 00 The question is how 'od' handles endianness. When you're asking it to display units larger than a single byte (-x displays 16-bit ...


1

Any day of the year before the first Monday will be week 00. Take January 1 2020 for instance, which was a Wednesday (the first Monday of 2020 did not occur until January 6): $ date -d "2020-01-01" +%W 00 $ date -d "2020-01-02" +%W 00 $ date -d "2020-01-03" +%W 00 $ date -d "2020-01-04" +%W 00 $ date -d "2020-01-...


1

Simeplest solution I could think of: sort -u file1.txt file2.txt > result.txt


Only top voted, non community-wiki answers of a minimum length are eligible