We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Lonely Integer - Bash!
Lonely Integer - Bash!
Sort by
recency
|
197 Discussions
|
Please Login in order to post a comment
!/bin/bash
read -r n read -r line
echo "$line" | tr " " "\n" | sort | uniq -u
read N read m echo $m | tr ' ' '\n' > file.txt sort file.txt | uniq -u
tr " " "\n" | tail +2 | sort | uniq -utr is used so each array element in new line for further processing tail is used to skip 1st line which contain total no. of array elements sort for uniq cmd to work as desired uniq -u print only the uniq element