[Asterisk-Users] echo system command and set the results to a new variable

Henry Junior henryjunior at gmail.com
Mon Aug 29 15:39:47 MST 2005


I am looking to issue a 'System cmd' that will echo the results into  
a new variable -- can anyone tell me the correct way to do this?

example: at the terminal I am currently able to issue this command:  
echo | date > date.txt
I end up with a file called date.txt with the contents: Mon Aug 29  
18:32:45 EDT 2005

I would like to issue a command in my dialplan that puts the date  
into a new variable something like this:
System(echo | date > Set(newVariableName=theDateEchoReturns)

So that the newVariableName=Mon Aug 29 18:32:45 EDT 2005

The objective in this case is to format the date according to the  
Unix Time format listed above.  I am certainly open to other options  
for doing this.  The default ${TIMESTAMP} format doesn't work for my  
needs.

Thanks!





More information about the asterisk-users mailing list