[comp.unix.questions] Novice questions about shell syntax

brad@SSD.CSD.HARRIS.COM (Brad Appleton) (08/08/90)

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! ~~~~~~~~~~~~~~~~~~~