1
0

env.rc 802 B

12345678910111213141516171819202122232425262728
  1. #!/cmd/rc
  2. # verify that environment variables can have names 127 byte long
  3. # why 127? because it's the size of genbuf in the kernel's Proc structure
  4. # minus the ending \0
  5. abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef012345678=10
  6. if ( ! ~ $abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef012345678 10 ) {
  7. echo FAIL: cannot read an environment variable with a long name
  8. exit FAIL
  9. }
  10. # verify that rc lists work
  11. list=(How now brown cow)
  12. string=$"list
  13. if( ! ~ $#list 4 ) {
  14. echo FAIL: list count does not work on a 4 elements list
  15. exit FAIL
  16. }
  17. if( ! ~ $#string 1 ) {
  18. echo FAIL: list count does not work on a single string
  19. exit FAIL
  20. }
  21. echo PASS
  22. exit PASS