Don't prune duplicate services in the expected output from /etc/services on
FreeBSD Submitted by: pho
This commit is contained in:
parent
da49f6bcc3
commit
b6fbc510be
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=273933
@ -81,6 +81,24 @@ servent_body()
|
||||
}
|
||||
' | sort >exp
|
||||
|
||||
case "$(uname)" in
|
||||
FreeBSD)
|
||||
# (3) Don't prune duplicates
|
||||
tr '\t' ' ' < /etc/services |
|
||||
sed 's/#.*//;s/ */ /g; /^$/d;s#\([0-9]\)/#\1 #;s/ *$//' |
|
||||
sort |
|
||||
while read l; do
|
||||
set $l
|
||||
name=$1; shift
|
||||
port=$1; shift
|
||||
proto=$1; shift
|
||||
alias="$@"
|
||||
printf "name=%s, port=%s, proto=%s, aliases=%s\n" \
|
||||
$name $port $proto "$alias"
|
||||
done > exp
|
||||
;;
|
||||
esac
|
||||
|
||||
# run test program
|
||||
"$(atf_get_srcdir)/h_servent" | sed 's/ *$//' | sort >out
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user