Writing a String returning macro

How can we write a macro which return a string.
Thank you

Return to where? Be more specific.

TString MacroReturningAString()
   TString s;
   return s;

Assume there is a long bash command of several lines you have to type by your keyboard. This long command has iterative words, so that you can create this whole command using loops in a macro and this macro returns this whole command. You can use this returned string in a bash script along with the macro. The macro generates the string and it is eventually used in bash.

shell script returnedstring.sh


string=`root -q -l -b -n string.C`

result=`echo $string | sed -e "s/Processing string.C... //"`

echo string = $result

macro string.C

cout<< "hello world"<<endl;


$ sh returnedstring.sh
string = hello world

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.