Artifact 07e25e6903cbac968badeca489ca3ecb43052a2a:
- Executable file stringify.tcl — part of check-in [1ef1b92a15] at 2014-09-07 10:38:27 on branch trunk — Updated to use Tcl to do all the heavy lifting (user: rkeene, size: 405) [annotate] [blame] [check-ins using]
#! /usr/bin/env tclsh proc stringifyfile {filename {key 0}} { catch { set fd [open $filename r] } if {![info exists fd]} { return "" } set data [read -nonewline $fd] close $fd foreach line [split $data \n] { set line [string map [list "\\" "\\\\" "\"" "\\\""] $line] append ret " \"$line\\n\"\n" } return $ret } foreach file $argv { puts -nonewline [stringifyfile $file] } exit 0