Skip to content

Commit 1a405ac

Browse files
committed
Update hosts script to remove duplicate addresses
1 parent c93b31a commit 1a405ac

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

hosts.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#!/bin/bash
22

33
in=$1
4+
temp=temp.$1
45
out=hosts.$1
56

6-
dig -f $in +noall +short | tee -a $out
7+
dig -f $in +noall +short | tee -a $temp && \
8+
sort -u $temp > $out && \
9+
rm $temp

0 commit comments

Comments
 (0)