1
0

args.rc 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #!/cmd/rc
  2. # verify that rc scripts get the correct arguments
  3. /qa/kern/args.rc.0 a b c
  4. a0=`{echo $STATUS|awk '{print $3}'}
  5. a0=$"a0 #"
  6. /qa/kern/args.rc.1 a b c
  7. a1=`{echo $STATUS|awk '{print $3}'}
  8. a1=$"a1 #"
  9. /qa/kern/args.rc.2 a b c
  10. a2=`{echo $STATUS|awk '{print $3}'}
  11. a2=$"a2 #"
  12. /qa/kern/args.rc.0
  13. b0=`{echo $STATUS|awk '{print $3}'}
  14. b0=$"b0 #"
  15. /qa/kern/args.rc.1
  16. b1=`{echo $STATUS|awk '{print $3}'}
  17. b1=$"b1 #"
  18. /qa/kern/args.rc.2
  19. b2=`{echo $STATUS|awk '{print $3}'}
  20. b2=$"b2 #"
  21. if (test -z $a0 || ! ~ $a0 /qa/kern/args.rc.0) {
  22. echo FAIL: '$0' in '/qa/kern/args.rc.0 a b c' was $a0
  23. exit FAIL
  24. }
  25. if (test -z $a1 || ! ~ $a1 a) {
  26. echo FAIL: '$1' in '/qa/kern/args.rc.1 a b c' was $a1
  27. exit FAIL
  28. }
  29. if (test -z $a2 || ! ~ $a2 b) {
  30. echo FAIL: '$2' in '/qa/kern/args.rc.2 a b c' was $a2
  31. exit FAIL
  32. }
  33. if (test -z $b0 || ! ~ $b0 /qa/kern/args.rc.0) {
  34. echo FAIL: '$0' in '/qa/kern/args.rc.0' was $b0
  35. exit FAIL
  36. }
  37. if (test -n $b1) {
  38. echo FAIL: '$1' in '/qa/kern/args.rc.1' was $b1
  39. exit FAIL
  40. }
  41. if (test -n $b2) {
  42. echo FAIL: '$2' in '/qa/kern/args.rc.2' was $b2
  43. exit FAIL
  44. }
  45. echo PASS
  46. exit PASS