]>
git.proxmox.com Git - ceph.git/blob - ceph/src/spdk/scripts/eofnl
2 # Make sure file has a trailing newline
7 echo "usage: $0 <file>"
11 if [ ! -f "$f" ]; then
15 if [[ $
(tail -c1 "$f") ]]; then
16 echo "$f: No newline at end of file"
21 if [[ ! $
(tail -c2 "$f") ]]; then
22 echo "$f: Extra trailing newline"
26 if grep -q $
'\r' "$f"; then
27 echo "$f: DOS-style newlines"
28 dos2unix
"$f" &> /dev
/null
32 if grep -q $
'[\t ]$' "$f"; then
33 echo "$f: Trailing whitespace"
34 sed -i $
's/[ \t]*$//' "$f"