File: rotated-data

package info (click to toggle)
dialog 1.0-20060221-3
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,040 kB
  • ctags: 1,239
  • sloc: ansic: 11,308; sh: 7,591; perl: 355; makefile: 238; python: 164
file content (23 lines) | stat: -rwxr-xr-x 369 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
# $Id: rotated-data,v 1.1 2004/12/19 16:43:47 tom Exp $
# Rotate the second parameter's data by the given shift count.
if test $# != 0
then
	case $1 in
	[1-9]*)
		left=$1
		next=`expr $left + 1`
		shift 1
		;;
	*)
		left=1
		next=2
		;;
	esac
	char=`echo "$@" | cut -b -${left}`
	data=`echo "$@" | cut -b ${next}-`

	printf "%s%s\n" $data $char
else
	echo
fi