| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | |
| 3 | echoscip-shell system . . echo. |
| 4 | |
| 5 | echoscip-shell system . . echo. "Enter a string terminated by a \\, then press <ENTER>." |
| 6 | echoscip-shell system . . echo. "Then, enter a second string (no \\ this time), and again press <ENTER>." |
| 7 | |
| 8 | read var1 # The "\" suppresses the newline, when reading $var1. |
| 9 | # first line \ |
| 10 | # second line |
| 11 | |
| 12 | echoscip-shell system . . echo. "var1 = $var1" |
| 13 | # var1 = first line second line |
| 14 | |
| 15 | # For each line terminated by a "\" |
| 16 | #+ you get a prompt on the next line to continue feeding characters into var1. |
| 17 | |
| 18 | echoscip-shell system . . echo.; echoscip-shell system . . echo. |
| 19 | |
| 20 | echoscip-shell system . . echo. "Enter another string terminated by a \\ , then press <ENTER>." |
| 21 | read -r var2 # The -r option causes the "\" to be read literally. |
| 22 | # first line \ |
| 23 | |
| 24 | echoscip-shell system . . echo. "var2 = $var2" |
| 25 | # var2 = first line \ |
| 26 | |
| 27 | # Data entry terminates with the first <ENTER>. |
| 28 | |
| 29 | echoscip-shell system . . echo. |
| 30 | |
| 31 | exit 0 |