[email protected]: I have file with lines:
>> aaa
>> bbb
>> ccc
>>
>> I need to produce:
>> 'aaa'
>> 'bbb'
>> 'ccc'
Janis Papanagnou wrote the perfect one-liner:
printf "'%s'\n" $(< your_file )
which is a very good illustration of printf's format string reuse:
"If the number of arguments exceeds the number of format
specifications, the format string is reused to
format remaining arguments."
ref: ksh(1), printf format [ arg ... ]
Cheer,
Henk
P.s: Has lazy evaluation already been added to ksh, perchance?
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users