Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!spool.mu.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ucbvax!cel.cummins.com!philip From: philip@cel.cummins.com (Philip D. Pokorny) Newsgroups: comp.sys.apollo Subject: Getting old..... Message-ID: <9106142236.AA03542@cel.cummins.com> Date: 14 Jun 91 22:36:09 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 62 I must be getting old... I can't remember if I posted this to the newsgroup, or who the original requestor was... One of my sys_admin cohorts, came up with this code that he believes he got at ADUS from a shell lecture... #!/com/sh # eon # My original posting???? n := 0 while (( ^"set -c args @"@^^n@"" <> "" )) do arg := ^"set -c args @^^n" args (( "Argument " + ^n + ": " + ^arg )) n := ^n + 1 enddo # New and improved posting... args "" "" n := 0 while not set -c "eqs ^^n" do set -c "arg := ^^n" args (( "Argument " + ^n + ": " + ^arg )) n := ^n + 1 enddo # Shell class example: args "" "" # Count arguments... i := 0 while not set -c "eqs ^^i" do # Create "array" set -c "argv^i := ^^i" i := ^i +1 enddo # Save number of arguments... argc := ^i -1 # for i := 0 to ^argc # Get argument from "array" set -c "arg := @^argv^i" args (( "Argument " + ^i + ": " + ^arg )) n := ^n + 1 endfor # Dump variables to prove we worked... args "" "" lvar :)