From owner-freebsd-stable Fri Sep 15 7:55:58 2000 Delivered-To: freebsd-stable@freebsd.org Received: from topperwein.dyndns.org (acs-24-154-28-99.zoominternet.net [24.154.28.99]) by hub.freebsd.org (Postfix) with ESMTP id AA4CA37B423 for ; Fri, 15 Sep 2000 07:55:55 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by topperwein.dyndns.org (8.9.3/8.9.3) with ESMTP id KAA38665 for ; Fri, 15 Sep 2000 10:59:32 -0400 (EDT) (envelope-from behanna@zbzoom.net) Date: Fri, 15 Sep 2000 10:59:32 -0400 (EDT) From: Chris BeHanna Reply-To: behanna@zbzoom.net To: FreeBSD-Stable Subject: Re: "set -A" Bourne script - a nogo on FreeBSD In-Reply-To: <20000914225233.A1971@nc.rr.com> Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/Mixed; BOUNDARY=YZ5djTAD1cGYuMQK Content-ID: Content-Disposition: INLINE Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --YZ5djTAD1cGYuMQK Content-Type: TEXT/PLAIN; CHARSET=US-ASCII Content-ID: Content-Disposition: INLINE On Thu, 14 Sep 2000, Randall Hopper wrote: > 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. You need to install ksh to use set -A. -- Chris BeHanna Software Engineer (at yourfit.com) behanna@zbzoom.net --YZ5djTAD1cGYuMQK Content-Type: TEXT/PLAIN; CHARSET=us-ascii Content-ID: Content-Description: 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