escape.exp revision 281760
1281760Ssjgvar-1bs 2281760Ssjgprintf "%s=:%s:\n" VAR1BS 111\\111; printf "%s=:%s:\n" VAR1BSa 111\\aaa; printf "%s=:%s:\n" VAR1BSA 111\\aaa; printf "%s=:%s:\n" VAR1BSda 111\\\$\{a\}; printf "%s=:%s:\n" VAR1BSdA 111\\\$\{A\}; printf "%s=:%s:\n" VAR1BSc 111\#\ backslash\ escapes\ comment\ char,\ so\ this\ is\ part\ of\ the\ value; printf "%s=:%s:\n" VAR1BSsc 111\\\ ; 3281760SsjgVAR1BS=:111\111: 4281760SsjgVAR1BSa=:111\aaa: 5281760SsjgVAR1BSA=:111\aaa: 6281760SsjgVAR1BSda=:111\${a}: 7281760SsjgVAR1BSdA=:111\${A}: 8281760SsjgVAR1BSc=:111# backslash escapes comment char, so this is part of the value: 9281760SsjgVAR1BSsc=:111\ : 10281760Ssjgvar-2bs 11281760Ssjgprintf "%s=:%s:\n" VAR2BS 222\\\\222; printf "%s=:%s:\n" VAR2BSa 222\\\\aaa; printf "%s=:%s:\n" VAR2BSA 222\\\\aaa; printf "%s=:%s:\n" VAR2BSda 222\\\\\$\{a\}; printf "%s=:%s:\n" VAR2BSdA 222\\\\\$\{A\}; printf "%s=:%s:\n" VAR2BSc 222\\\\; printf "%s=:%s:\n" VAR2BSsc 222\\\\; 12281760SsjgVAR2BS=:222\\222: 13281760SsjgVAR2BSa=:222\\aaa: 14281760SsjgVAR2BSA=:222\\aaa: 15281760SsjgVAR2BSda=:222\\${a}: 16281760SsjgVAR2BSdA=:222\\${A}: 17281760SsjgVAR2BSc=:222\\: 18281760SsjgVAR2BSsc=:222\\: 19281760Ssjgvar-1bsnl 20281760Ssjgprintf "%s=:%s:\n" VAR1BSNL 111\ 111; printf "%s=:%s:\n" VAR1BSNLa 111\ aaa; printf "%s=:%s:\n" VAR1BSNLA 111\ aaa; printf "%s=:%s:\n" VAR1BSNLda 111\ \$\{a\}; printf "%s=:%s:\n" VAR1BSNLdA 111\ \$\{A\}; printf "%s=:%s:\n" VAR1BSNLc 111; printf "%s=:%s:\n" VAR1BSNLsc 111; 21281760SsjgVAR1BSNL=:111 111: 22281760SsjgVAR1BSNLa=:111 aaa: 23281760SsjgVAR1BSNLA=:111 aaa: 24281760SsjgVAR1BSNLda=:111 ${a}: 25281760SsjgVAR1BSNLdA=:111 ${A}: 26281760SsjgVAR1BSNLc=:111: 27281760SsjgVAR1BSNLsc=:111: 28281760Ssjgvar-2bsnl 29281760Ssjgprintf "%s=:%s:\n" VAR2BSNL 222\\\\; printf "%s=:%s:\n" VAR2BSNLa 222\\\\; printf "%s=:%s:\n" VAR2BSNLA 222\\\\; printf "%s=:%s:\n" VAR2BSNLda 222\\\\; printf "%s=:%s:\n" VAR2BSNLdA 222\\\\; printf "%s=:%s:\n" VAR2BSNLc 222\\\\; printf "%s=:%s:\n" VAR2BSNLsc 222\\\\; 30281760SsjgVAR2BSNL=:222\\: 31281760SsjgVAR2BSNLa=:222\\: 32281760SsjgVAR2BSNLA=:222\\: 33281760SsjgVAR2BSNLda=:222\\: 34281760SsjgVAR2BSNLdA=:222\\: 35281760SsjgVAR2BSNLc=:222\\: 36281760SsjgVAR2BSNLsc=:222\\: 37281760Ssjgvar-3bsnl 38281760Ssjgprintf "%s=:%s:\n" VAR3BSNL 333\\\\\ 333=; printf "%s=:%s:\n" VAR3BSNLa 333\\\\\ aaa=; printf "%s=:%s:\n" VAR3BSNLA 333\\\\\ aaa=; printf "%s=:%s:\n" VAR3BSNLda 333\\\\\ \$\{a\}=; printf "%s=:%s:\n" VAR3BSNLdA 333\\\\\ \$\{A\}=; printf "%s=:%s:\n" VAR3BSNLc 333\\\\; printf "%s=:%s:\n" VAR3BSNLsc 333\\\\; 39281760SsjgVAR3BSNL=:333\\ 333=: 40281760SsjgVAR3BSNLa=:333\\ aaa=: 41281760SsjgVAR3BSNLA=:333\\ aaa=: 42281760SsjgVAR3BSNLda=:333\\ ${a}=: 43281760SsjgVAR3BSNLdA=:333\\ ${A}=: 44281760SsjgVAR3BSNLc=:333\\: 45281760SsjgVAR3BSNLsc=:333\\: 46281760Ssjgvar-1bsnl-space 47281760Ssjgprintf "%s=:%s:\n" VAR1BSNL00 first\ line; printf "%s=:%s:\n" VAR1BSNL0 first\ line\ no\ space\ on\ second\ line; printf "%s=:%s:\n" VAR1BSNLs first\ line\ one\ space\ on\ second\ line; printf "%s=:%s:\n" VAR1BSNLss first\ line\ two\ spaces\ on\ second\ line; printf "%s=:%s:\n" VAR1BSNLt first\ line\ one\ tab\ on\ second\ line; printf "%s=:%s:\n" VAR1BSNLtt first\ line\ two\ tabs\ on\ second\ line; printf "%s=:%s:\n" VAR1BSNLxx first\ line\ many\ spaces\ and\ tabs\ \[\ \ \ \ \]\ on\ second\ line; 48281760SsjgVAR1BSNL00=:first line: 49281760SsjgVAR1BSNL0=:first line no space on second line: 50281760SsjgVAR1BSNLs=:first line one space on second line: 51281760SsjgVAR1BSNLss=:first line two spaces on second line: 52281760SsjgVAR1BSNLt=:first line one tab on second line: 53281760SsjgVAR1BSNLtt=:first line two tabs on second line: 54281760SsjgVAR1BSNLxx=:first line many spaces and tabs [ ] on second line: 55281760Ssjgcmd-1bsnl 56281760Ssjgecho :'first line\ 57281760Ssjg#second line without space\ 58281760Ssjgthird line': 59281760Ssjg:first line\ 60281760Ssjg#second line without space\ 61281760Ssjgthird line: 62281760Ssjgecho :'first line\ 63281760Ssjg second line spaces should be retained': 64281760Ssjg:first line\ 65281760Ssjg second line spaces should be retained: 66281760Ssjgecho :'first line\ 67281760Ssjgsecond line tab should be elided': 68281760Ssjg:first line\ 69281760Ssjgsecond line tab should be elided: 70281760Ssjgecho :'first line\ 71281760Ssjg only one tab should be elided, second tab remains' 72281760Ssjg:first line\ 73281760Ssjg only one tab should be elided, second tab remains 74281760Ssjgcmd-1bsnl-eof 75281760Ssjgecho :'command ending with backslash-newline'; \ 76281760Ssjg 77281760Ssjg:command ending with backslash-newline 78281760Ssjgcmd-2bsnl 79281760Ssjgecho take one\\ 80281760Ssjgtake one\ 81281760Ssjgecho take two\\ 82281760Ssjgtake two\ 83281760Ssjgecho take three\\ 84281760Ssjgtake three\ 85281760Ssjgcmd-3bsnl 86281760Ssjgecho :'first line\\\ 87281760Ssjg#second line without space\\\ 88281760Ssjgthird line': 89281760Ssjg:first line\\\ 90281760Ssjg#second line without space\\\ 91281760Ssjgthird line: 92281760Ssjgecho :'first line\\\ 93281760Ssjg second line spaces should be retained': 94281760Ssjg:first line\\\ 95281760Ssjg second line spaces should be retained: 96281760Ssjgecho :'first line\\\ 97281760Ssjgsecond line tab should be elided': 98281760Ssjg:first line\\\ 99281760Ssjgsecond line tab should be elided: 100281760Ssjgecho :'first line\\\ 101281760Ssjg only one tab should be elided, second tab remains' 102281760Ssjg:first line\\\ 103281760Ssjg only one tab should be elided, second tab remains 104281760Ssjgexit status 0 105