author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Mon, 15 Mar 2010 12:43:09 +0200 | |
branch | RCL_3 |
changeset 6 | dee5afe5301f |
parent 0 | 1918ee327afb |
permissions | -rw-r--r-- |
0 | 1 |
#!/bin/sh |
2 |
||
3 |
LEN="$1" |
|
4 |
STR="$2" |
|
5 |
PAD='\0' |
|
6 |
STRLEN=`echo $STR | wc -c` |
|
7 |
RES="$STR" |
|
8 |
||
9 |
EXTRALEN=`expr $LEN - $STRLEN` |
|
10 |
while [ "$EXTRALEN" -gt 32 ]; do |
|
11 |
RES="$RES$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD$PAD" |
|
12 |
EXTRALEN=`expr $EXTRALEN - 32` |
|
13 |
done |
|
14 |
while [ "$EXTRALEN" -gt 0 ]; do |
|
15 |
RES="$RES$PAD" |
|
16 |
EXTRALEN=`expr $EXTRALEN - 1` |
|
17 |
done |
|
18 |
cat <<EOF |
|
19 |
$RES |
|
20 |
EOF |
|
21 |
||
22 |