Root/
| 1 | #!/bin/bash |
| 2 | . ./Common |
| 3 | |
| 4 | ############################################################################### |
| 5 | |
| 6 | tst "substitutions: print input variable" -ds -q foo=bar <<EOF |
| 7 | !-s |
| 8 | print foo |
| 9 | EOF |
| 10 | |
| 11 | expect <<EOF |
| 12 | print foo |
| 13 | foo(in) = "bar" |
| 14 | EOF |
| 15 | |
| 16 | #------------------------------------------------------------------------------ |
| 17 | |
| 18 | tst "substitutions: print output variable" -q <<EOF |
| 19 | !-s |
| 20 | foo = x |
| 21 | print foo |
| 22 | EOF |
| 23 | |
| 24 | expect <<EOF |
| 25 | foo(out) = "x" |
| 26 | foo=x |
| 27 | EOF |
| 28 | |
| 29 | #------------------------------------------------------------------------------ |
| 30 | |
| 31 | tst "substitutions: print output variable overriding input" -q x=y <<EOF |
| 32 | !-s |
| 33 | x = z |
| 34 | print x |
| 35 | EOF |
| 36 | |
| 37 | expect <<EOF |
| 38 | x(out) = "z" |
| 39 | x=z |
| 40 | EOF |
| 41 | |
| 42 | #------------------------------------------------------------------------------ |
| 43 | |
| 44 | tst "substitutions: print unknown variable" -q <<EOF |
| 45 | !-s |
| 46 | print x |
| 47 | EOF |
| 48 | |
| 49 | expect <<EOF |
| 50 | x = ? |
| 51 | EOF |
| 52 | |
| 53 | #------------------------------------------------------------------------------ |
| 54 | |
| 55 | tst "substitutions: print conditionally defined variable" -q x=y <<EOF |
| 56 | !-s |
| 57 | x=y { z=1 } |
| 58 | print z |
| 59 | EOF |
| 60 | |
| 61 | expect <<EOF |
| 62 | z(out) = "1" |
| 63 | z=1 |
| 64 | EOF |
| 65 | |
| 66 | #------------------------------------------------------------------------------ |
| 67 | |
| 68 | tst "substitutions: print conditionally undefined variable" -q x=z <<EOF |
| 69 | !-s |
| 70 | x=y { z=1 } |
| 71 | print z |
| 72 | EOF |
| 73 | |
| 74 | expect <<EOF |
| 75 | z = ? |
| 76 | EOF |
| 77 | |
| 78 | ############################################################################### |
| 79 |
Branches:
master
