I have a squirrel plugin which invokes "echo". It is almost correct, but despite having considered various responses on stackoverflow to this problem (and on other unix-related sites) as to how to deal with the "whitespace" or metacharacter issue, I have not been able to get "echo" to work.
The squirrel plugin is as follows:
fe.add_transition_callback( "removefavourite" );
function removefavourite( ttype, var, ttime )
{
switch ( ttype )
{
case Transition.ChangedTag:
fe.plugin_command( "/bin/echo", "\"" + fe.game_info( Info.Name ) + "\"" + " > " + "\"" + "/home/pi/.attract/romlists/REMOVEFAVOURITE.temp\"");
return false;
}}
The error I receive is as follows:
The parameter word expansion failed. ["Sam's Journey (Easyflash)" > "/home/pi/attract/romlists/REMOVEFAVOURITE.temp"].
The code is effective to pass the output to the terminal. However, it will not redirect the output to the REMOVEFAVOURITE.temp file. The problem appears to be the whitespace surrounding the " > " or the ">" itself.
I've tried dozens of alternatives to the " > ", but none has worked. How do I create a "space" to pass to the script which is acceptable to it please? Thanks.