I want to set a variable in a macro by performing an action on a file in the shell directory. I can get the shell command working fine with a number of commands, but cannot figure out how to do anything other than print to the screen. Is what I want possible?
Thanks, but that only redirects output to a file and I’d hoped to set the macro variable directly. Is that possible, or should I just send to a file and read that?
popen should work just fine for this. Most implementations however aren’t bidirectional, so while grepping for several lines is an easy task with popen, if you were to specify “w+” as the type of the stream you’re opening you can’t expect bidirectional behavior to be portable.