Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!umd5!brl-adm!adm!rbj@icst-cmr.arpa From: rbj@icst-cmr.arpa (Root Boy Jim) Newsgroups: comp.unix.questions Subject: Picking a character from a word Message-ID: <13125@brl-adm.ARPA> Date: 26 Apr 88 21:28:42 GMT Sender: news@brl-adm.ARPA Lines: 26 From: "Richard A. O'Keefe" Unfortunately, "expr substr" is a BSD-ism which has yet to find its way into the SVID. Or the manual entry. Here is yes another solution. I assume your word has no spaces in it, or else it would be many words. set x=abcdefghijklmnopqrstuvwxyz # input `word' set y=(`echo $x | sed 's/./& /g'`) # chg each char to a word set z=$y[17] # select char, 1-origin indexing echo $z # should produce `q' Oh the joys of macro processors; fun till it hurts. Yeah, but it feels so good when you stop. (Root Boy) Jim Cottrell National Bureau of Standards Flamer's Hotline: (301) 975-5688 The opinions expressed are solely my own and do not reflect NBS policy or agreement The PINK SOCKS were ORIGINALLY from 1952!! But they went to MARS around 1953!!