From owner-freebsd-stable Thu Sep 14 19:51:59 2000 Delivered-To: freebsd-stable@freebsd.org Received: from rr.com (rdu25-12-060.nc.rr.com [24.25.12.60]) by hub.freebsd.org (Postfix) with ESMTP id 1787137B422 for ; Thu, 14 Sep 2000 19:51:53 -0700 (PDT) Received: (from rhh@localhost) by rr.com (8.9.3/8.9.3) id WAA02072 for freebsd-stable@FreeBSD.ORG; Thu, 14 Sep 2000 22:52:34 -0400 (EDT) (envelope-from aa8vb@nc.rr.com) Date: Thu, 14 Sep 2000 22:52:34 -0400 From: Randall Hopper To: freebsd-stable@FreeBSD.ORG Subject: "set -A" Bourne script - a nogo on FreeBSD Message-ID: <20000914225233.A1971@nc.rr.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="YZ5djTAD1cGYuMQK" Content-Disposition: inline User-Agent: Mutt/1.2i Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --YZ5djTAD1cGYuMQK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline I pulled this off "ASCII chart" script off UNIX Tip of the Day. It worked fine at work on IRIX, but no such luck here on FreeBSD at home. Seems FreeBSD's Bourne shell's "set" command doesn't support -A. Randall --YZ5djTAD1cGYuMQK Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=ascii_chart #! /bin/sh # Shell script to generate all characters from # \0000 to \0377 (octal format) # Created by Declan.Forde@bk.bosch.de loop1='0 1 2 3' loop2='0 1 2 3 4 5 6 7' set -A array 0 1 2 3 4 5 6 7 echo " ${array[0]} ${array[1]} ${array[2]} ${array[3]} \ ${array[4]} ${array[5]} ${array[6]} ${array[7]} " echo for i in $loop1; do for j in $loop2; do echo "$i$j \0$i$j${array[0]} \0$i$j${array[1]} \ \0$i$j${array[2]} \0$i$j${array[3]} \0$i$j${array[4]} \ \0$i$j${array[5]} \0$i$j${array[6]} \0$i$j${array[7]}" done done echo echo " ${array[0]} ${array[1]} ${array[2]} ${array[3]} \ ${array[4]} ${array[5]} ${array[6]} ${array[7]} " echo --YZ5djTAD1cGYuMQK-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message