command_line() is smarter than I thought

new topic     » topic index » view thread      » older message » newer message

I was writing a short program to prepend text to each line of
STDIN and write it to STDOUT.

ex prepend ABC <example1 >example2

Worked fine until I had to prepend a space character, I'd always
assumed that a command line like...ex prepend " " would result
in a command_line() return value of 4 sequences, the 3rd and 4th
being speech marks.  But I was wrong.

ex prepend "ABC " <example1 >example2

return value 3 of command_line() is {65,66,67,32}

ex prepend " " <example1 >example2

return value 3 of command_line() is {32}

I didn't have to modify the program after all.


Matthew McNamara                          _
mat at iconz.co.nz                         o( )
The Internet Company of New Zealand    /  /\

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu