Bourne Shell (/bin/sh) counting?

Bourne Shell (/bin/sh) counting?

Post by Doug Gw » Mon, 19 Mar 1990 11:39:12



i=`expr $i + 1`
 
 
 

1. Bourne Shell (/bin/sh) counting?


Some people think that this answer is best thought of as a techie joke...
        count=`expr $count + 1`
              ^    ^      ^ ^ ^  
The spaces a VERY significant, as are the reversed quotes. However it works
and is useful in several of scripts.

This is even funnier:
        count=` echo $count|awk '{print $1 + 1}'`

I'd like to see a neat solution (other than a "increment.c" program).

Dick Botting,
Department of computer science,
California State University, San Bernardino, CA 92407



voice:714-880-5327

2. Lost Partition Table....

3. Should the Bourne shell (/bin/sh) expand tilde (~) for home directories?

4. humminbird cant start dtlogin

5. Bourne Shell (/bin/sh) & clobber

6. DOSEMU

7. root's shell, /sbin/sh, /bin/sh and /usr/ksh

8. Solaris type 6 USB kbd Props/blank key same?

9. #!/bin/sh #!/usr/bin/sh can I do both for 2 diff machines

10. more secure?: "#!/bin/sh -" or "#!/bin/sh"

11. ${1+"$@"} in /bin/sh family of shells shell scripts

12. Light Speed Bourne Shell! (was: Bourne shell tricks)

13. Bourne shell (sh) behaviour