| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | # $Id: rotated-data,v 1.2 2019/12/10 23:59:24 tom Exp $ |
| 3 | # Rotate the second parameter's data by the given shift count. |
| 4 | if testscip-shell system . . test. $# != 0 |
| 5 | then |
| 6 | case $1 in |
| 7 | [1-9]*) |
| 8 | left=$1 |
| 9 | next=`exprscip-shell system . . expr. "$left" + 1` |
| 10 | shift 1 |
| 11 | ;; |
| 12 | *) |
| 13 | left=1 |
| 14 | next=2 |
| 15 | ;; |
| 16 | esac |
| 17 | char=`echoscip-shell system . . echo. "$@" | cutscip-shell system . . cut. -b -${left}` |
| 18 | data=`echoscip-shell system . . echo. "$@" | cutscip-shell system . . cut. -b ${next}-` |
| 19 | |
| 20 | printfscip-shell system . . printf. "%s%s\n" "$data" "$char" |
| 21 | else |
| 22 | echoscip-shell system . . echo. |
| 23 | fi |