aboutsummaryrefslogblamecommitdiff
path: root/bin/d2u
blob: a2cb913a976cfb923ca62c7b6e9f46f4ef23ca2b (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
         



                                       







                                
#!/bin/sh
if [ "$#" -eq 0 ] ; then
    printf >&2 'd2u: Need a filename\n'
    exit 2
fi
r=$(printf '\r')
for fn ; do
    ed -s -- "$fn" <<EOF || ex=1
g/$r\$/ s/$r\$//
w
EOF
done
exit "${ex:-0}"