home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / next / bugs / 46 < prev    next >
Encoding:
Text File  |  1993-01-12  |  885 b   |  39 lines

  1. Newsgroups: comp.sys.next.bugs
  2. Path: sparky!uunet!news.univie.ac.at!chx400!bernina!waldvoge
  3. From: waldvoge@nessie.cs.id.ethz.ch (Marcel Waldvogel)
  4. Subject: /bin/sh $# bug with nested functions
  5. Message-ID: <1993Jan12.160259.7994@bernina.ethz.ch>
  6. Sender: news@bernina.ethz.ch (USENET News System)
  7. Organization: Swiss Federal Institute of Technology (ETH), Zurich, CH
  8. Date: Tue, 12 Jan 1993 16:02:59 GMT
  9. Lines: 28
  10.  
  11. Another nasty bug (which prevents me using 'shql' for now):
  12.  
  13.     #!/bin/sh
  14.     nested_func(){
  15.             echo "inside: $#"
  16.     }
  17.     func(){
  18.             echo "before: $#"
  19.             nested_func 6 7 8
  20.             echo "after : $#"
  21.     }
  22.     func 1 2 3 4 5
  23.  
  24. gives the following output (on 2.1 and on 3.0):
  25.  
  26.     before: 5
  27.     inside: 3
  28.     after : 3
  29.  
  30. Every other system I've tried returns
  31.  
  32.     before: 5
  33.     inside: 3
  34.     after : 5
  35.  
  36. This is in accordance to what I expect from the behaviour of parameter passing.
  37.  
  38. -Marcel
  39.