in reply to Re: backticks execution "inside" variable (string)
in thread backticks execution "inside" variable (string)

Hello Hauke,

I am aware that using backticks may be risky (how much, depends on use case context), thank you for your cautions anyway, better measuring multiple times, than doing something ill-judged and then having problems.

In my case, I am doing automated conversions of log monitoring policies from legacy monitoring system to correlation engine with prescribed correlation templates. Input policies and also correlation templates are using backticks to handle multi-file logs, and it is out of scope of my task, changing these prescribed input and output norms (it would be much more work and this is currently out of project scope), so adapted to these norms, and used backticks also internaly in my conversions and also when generating automated tests. Although currently only dates are in backticks, in general, in general there can be any meainingful command, so I am doing general solution, repeatedly usable also in future, not just covering dates. There is some level of trust, that backticks contents was verified in the past, and also during the analysis before doing automated conversion, and conversions and correlations are running under unprivileged user, so I see the risk level as acceptable in this case, and I am carefully thinking about potential "what ifs" and testing. My showcase was very shortened, removed from its context, so I was interested in very specific thing, not finding alternative solutions what to use instead of backticks, because I know you can't know all the requirements and limitations.

It is not interesting fo me, finding "who did it" (shell or Perl), I saw, where was the problem (shell was in the service of Perl in this case, so I am in charge to solve this problem by Perl, so I am writing this in Perl forum instead of some shell user group).

Thank you for all your tips anyway - currently having little time capacity to read thoroughly all articles you provided, I flied them with my eyes and bookmarked.

May the Perl be with you.

Richard

  • Comment on Re^2: backticks execution "inside" variable (string)