Path: utzoo!attcan!uunet!samsung!uakari.primate.wisc.edu!uflorida!travis!brad From: brad@SSD.CSD.HARRIS.COM (Brad Appleton) Newsgroups: comp.unix.questions Subject: Novice questions about shell syntax Summary: How do I set variables and arrays in BASH and TCSH? Keywords: shell variables, bash, csh, ksh, sh, tcsh Message-ID: <637@travis.csd.harris.com> Date: 8 Aug 90 14:27:31 GMT Sender: news@travis.csd.harris.com Organization: Harris Computers Systems Division, Fort Lauderdale,FL Lines: 44 I have some beginner questions concerning BASH and TCSH. I need to know (and have an example of) how to do the following in each: 1) set a shell variable to a value 2) set a shell variable to a word-list (or an array) 3) reset the positional parameters 4) unset the positional parameters At present, I am assuming that BASH sysntax would be the same as Bourne shell syntax (where applicable) and that TCSH wyntax would be the same as C shell syntax (where applicable) but I would like to know for certain! BTW, I know what BASH stands for but what does TCSH stand for? To my knowledge - Bourne, Korn, and C Shell examples for the above would be: sh ksh csh ------------------- ---------------------- -------------------------- 1) name=value name=value set name=value typeset name=value 2) N/A set -A name el1 el2 ... set name=( el1 el2 ... ) 3) set -- p1 p2 ... set -- p1 p2 ... set argv=( p1 p2 ... ) 4) shift $# unset -- set argv=() shift $# If there is a "more accepted" way to do any of these for sh, ksh, and csh (or if any of what I have above is incorrect) please let me know! advTHANXance ______________________ "And miles to go before I sleep." ______________________ Brad Appleton brad@travis.ssd.csd.harris.com Harris Computer Systems ...!uunet!hcx1!brad Fort Lauderdale, FL USA ~~~~~~~~~~~~~~~~~~~~ Disclaimer: I said it, not my company! ~~~~~~~~~~~~~~~~~~~