Berkeley CSUA MOTD:Entry 52425
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2025/05/24 [General] UID:1000 Activity:popular
5/24    

2009/1/20-26 [Computer/SW/Languages/Java, Computer/SW/Languages/Misc] UID:52425 Activity:nil
1/20    I've been using tcsh as shell program tool (i know, bad shell to
        do scripting).  One thing I've noticed when I extract xml file
        is that the variable type automatically change from
        integer/string to... almost an array-like data structure when
        the output of the xml key/value is more than one (it's more
        like a string separated by space, but I was very impressed as
        it is).  1. since *WHEN* did this happened?  or shell variable
        always behave this way?  2. I've notice that the first element
        of this "array" started with index of [1] instead of [0].
        This is rather different from c/java type of syntax.  is [0]
        reserved for something? or it's just a different convention?
        \_ I don't understand question 1. Tcsh is not strongly typed.
           It does have integers and strings, but that's about it.
           Are you talking about $FOO = "this is my string" versus
           $FOO = (this is my string)? For question 2, the convention is
           different, yes.