mirror of
https://salsa.debian.org/debian/debian-reference.git
synced 2026-01-11 20:07:28 +00:00
36 lines
681 B
Bash
Executable file
36 lines
681 B
Bash
Executable file
#!/bin/sh
|
|
# Copyright (C) 2009 Osamu Aoki <osamu@debian.org>
|
|
#
|
|
# This is free software with ABSOLUTELY NO WARRANTY.
|
|
#
|
|
# You can redistribute it and/or modify it under the terms of
|
|
# the GNU General Public License version 2 or later.
|
|
#
|
|
# Split PO file.
|
|
#
|
|
# po4a-strip chunks file.po
|
|
#
|
|
# ... output file.1.po file.2.po into chunks
|
|
#
|
|
# Use "wc -l file.po" to get rough idea.
|
|
#
|
|
c=$1
|
|
filein=$2
|
|
m=$( wc -l <$filein )
|
|
n=$(( $m/$c ))
|
|
fileout=${filein%.po}
|
|
i=1
|
|
l=1
|
|
while read X ; do
|
|
echo "$X" >> $fileout.$i.po
|
|
#echo $n $l $(( $n*$i )) $i
|
|
if [ $l -ge $(( $n*$i )) ] && [ -z "$X" ]; then
|
|
i=$(($i+1))
|
|
fi
|
|
l=$(($l+1))
|
|
done < $filein
|
|
|
|
#
|
|
#
|
|
# vim: set sts=2 ai expandtab:
|
|
|