repo.or.cz
/
cmdllinux.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
fix _make_git_tar_dir.sh - don't 'append directory' to symlinks
[cmdllinux.git]
/
scripts
/
_rm_file_end_linefeed.sh
blob
69666b58727de67a83c6dde54bd27a96df521e6a
1
[
-z
"
$1
"
] &&
exit
1
2
FILE
=
"
$1
"
3
4
while
true
;
do
5
SIZE
=
`stat -c %s "
$FILE
"`
6
[
"
$SIZE
"
-lt
1
] &&
exit
2
7
hex_end
=
`od -v -A n -t x1 -N 2 -j $(expr
$SIZE
- 2) "
$FILE
"`
8
[
"
$hex_end
"
=
" 0a 0a"
] &&
truncate
-s
$
(
expr
$SIZE
-
1
)
"
$FILE
"
||
break
9
done