Reading stdin from c-kermit script

Hello,

I think in this situation the approach I would take would be to have a shell script that did what was first necessary to populate cdr.txt, with all the information already parsed in a form that Kermit would be able to handle (so your script would also include the grep and sed steps). Then, once cdr.txt was fully prepared and contained everything already-written in the format that Kermit would require, you could use your shell script to run a Kermit script (or even build that Kermit script too, if necessary), and Kermit could read cdr.txt at runtime via a take statement.

Personally, I tend to try to avoid one-line solutions where possible, since having things written out in a script enables you to more easily see and grasp the flow of the logic of the problem you're trying to solve. There is also a reduced chance of errors or un-intended side effects being introduced that might not be obvious if you are trying to do everything in one single pipeline one time.

One-line pipelines certainly have their place - specifically, as one-off solutions to a particular problem or to carry out a particular task, when you do not anticipate this exact situation coming up again, or at least not regularly . But if you are trying to automate something, or do something in such a manner that you want it to be easily repeatable in the future, then a script rather than a one-line solution tends to be the way to go. This makes it easier to run again whenever it is needed, and also allows you to much more easily tweak and adapt it to changing requirements as time goes on.

Lastly, in this particular case, given that the Kermit documentation specifically warns agains trying to pipe things into Kermit to get it to use as its input, it is best to heed that warning, and change your strategy accordingly. Even if a way could be found to use stdin as Kermit's input, the developer clearly feels this to be unsafe, and has gone so far as to explicitly advise against doing this in the documentation. Here, I'd be inclined to trust that the Kermit developers most likely have a good reason for issuing such a warning.

Hope this helps ! If you have any further questions, please do let us know and we can see what we can do.