PageRenderTime 23ms CodeModel.GetById 16ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/contrib/dialog/samples/rotated-data

https://bitbucket.org/freebsd/freebsd-head/
Shell | 23 lines | 19 code | 1 blank | 3 comment | 1 complexity | 60856cbe643ed2fa7ba0d34b8016cbc7 MD5 | raw file
 1#!/bin/sh
 2# $Id: rotated-data,v 1.1 2004/12/19 16:43:47 tom Exp $
 3# Rotate the second parameter's data by the given shift count.
 4if test $# != 0
 5then
 6	case $1 in
 7	[1-9]*)
 8		left=$1
 9		next=`expr $left + 1`
10		shift 1
11		;;
12	*)
13		left=1
14		next=2
15		;;
16	esac
17	char=`echo "$@" | cut -b -${left}`
18	data=`echo "$@" | cut -b ${next}-`
19
20	printf "%s%s\n" $data $char
21else
22	echo
23fi