Skip to content

Commit

Permalink
new
Browse files Browse the repository at this point in the history
  • Loading branch information
vbrover committed Mar 11, 2021
1 parent 4140056 commit a300a08
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
9 changes: 9 additions & 0 deletions du.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash --noprofile
THIS=`dirname $0`
source $THIS/bash_common.sh
if [ $# -ne 1 ]; then
echo "#1: Directory"
exit 1
fi

du -s -m $1/*
19 changes: 19 additions & 0 deletions line.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash --noprofile
THIS=`dirname $0`
source $THIS/bash_common.sh
if [ $# -ne 2 ]; then
echo "#1: File name"
echo "#2: Line number"
exit 1
fi
F=$1
L=$2


N=`cat $F | wc -l`
if [ $L-gt $N ]; then
error "Max. line = $N"
fi

head -$L $F | tail -1

22 changes: 22 additions & 0 deletions rmBOM.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash --noprofile
THIS=`dirname $0`
source $THIS/bash_common.sh
if [ $# -ne 2 ]; then
echo "Remove UTF-8 Byte Order Mark"
echo "#1: Input text file"
echo "#2: Output file"
exit 1
fi
IN=$1
OUT=$2


if [ $IN == $OUT ];
error "$IN = $OUT"
fi

cat $IN | sed 's/^\xEF\xBB\xBF//1' | sed 's/^\xFE\xFF//1' | sed 's/^\xFF\xFE//1' > $OUT
rm $IN
wc -l $OUT


0 comments on commit a300a08

Please sign in to comment.