Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!ncar!noao!amethyst!eros!barsam From: barsam@eros.ame.arizona.edu (Barsam Marasli) Newsgroups: comp.unix.questions Subject: Picking a character from a word Message-ID: <578@amethyst.ma.arizona.edu> Date: 22 Apr 88 21:02:36 GMT Sender: uucp@amethyst.ma.arizona.edu Reply-To: eros!barsam@arizona.edu Distribution: na Organization: AME Dept., Univ. of Arizona at Tucson Lines: 19 I have a csh question. I would like to have a script that will echo, say the 4th character of an arguement. I came up with the following: set word=`echo $1 | od -c` ; echo $word[5] which seems to do the job but somehow I feel like there are more elegant ways of doing this. Please reply by e-mail or post. Also what's an alternative in sh? Thanx. ------------------------------------------------------------------------ Barsam Marasli Internet: eros!barsam@arizona.edu UUCP : ...{allegra,ihnp4,cmcl2,hao!noao}!arizona!eros!barsam Bitnet : barsam@arizrvax ------------------------------------------------------------------------ Barsam Marasli # Speak slowly, I hear with an accent. # Internet: eros!barsam@arizona.edu UUCP : ...{allegra,ihnp4,cmcl2,hao!noao}!arizona!eros!barsam Bitnet : barsam@arizrvax