writing scripts from scripts - backslash substitution in {..
Closed / Wont Fix219411ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 05:12:35
OriginalBugID: 6357 Bug
Version: 8.4a1
SubmitDate: '2000-10-16'
LastModified: '2000-10-25'
Severity: MED
Status: UnAssn
Submitter: techsupp
OS: Linux
FixedDate: '2000-10-25'
ClosedDate: '2000-10-25'
Name:
John Ellson
CVS:
Oct 12, 2000. 3am (patchlevel 8.4a2)
ReproducibleScript:
#!/usr/local/bin/tclsh8.4
### this backslash gets lost
set script {#!/bin/sh
# the next line is a comment in tcl, but executable by sh exec wish "$0" ${1+"$@"}
puts "hello world"
}
puts $script
### these backslashes remain doubled
set script {#!/bin/sh
# the next line is a comment in tcl, but executable by sh \\
exec wish "$0" ${1+"$@"}
puts "hello world"
}
puts $script
ObservedBehavior:
I'm trying to write a script from a tcl script, including the
magic initial construct:
#!/bin/sh
# the next line is a comment in tcl, but executable by sh exec wish "$0" ${1+"$@"}
tcl is substituting the trailing backslash even though the string is in braces.
DesiredBehavior:
no backslash substitutions in braced strings.
dkfplain2000-11-06 23:28:41
Tcl is defined to behave this way, and I'd be extremely hesitant to change it since it would probably adversely affect many other scripts. You'll just have to express the string constant in a different way... :^(
dgp Open ticket [219411ffff].
[History diff]2001-04-20 02:52:14
dgp Closed ticket [219411ffff].
[History diff]2001-04-20 02:53:39
Log in (anonymous is fine) to add a comment.