D
davidpthomas
GOAL: one-liner substitute of 5 spaces at beginning of a line.
WORKS: gsub(/^/, " ")
FAILS: gsub(/^/, 5.times {putc " "})
-example-
WORKS: $ cat foo.out | ruby -pe 'gsub(/^/, " ")'
FAILS: $ cat foo.out | ruby -pe 'gsub(/^/, 5.times{putc " "})'
I've tried variations of putc, puts, and print. All fail in different
ways.
thoughts? -- dave
WORKS: gsub(/^/, " ")
FAILS: gsub(/^/, 5.times {putc " "})
-example-
WORKS: $ cat foo.out | ruby -pe 'gsub(/^/, " ")'
FAILS: $ cat foo.out | ruby -pe 'gsub(/^/, 5.times{putc " "})'
I've tried variations of putc, puts, and print. All fail in different
ways.
thoughts? -- dave