Jump to content

strange command execution via variable


vinski

Recommended Posts

Dear Armbian community

I am currently porting some project from Debian/amd64 to Armbian (Debian GNU/Linux7 Wheezy) with shell and python and its impressive !

I though noticed strange behaviour on some command execution via variable and will here focus on a simple date sync example :

1. nc command :

from shell or from script : nc time.nist.gov 13 revert a typical 46 char long ASCII answer.

via a variable, a=$(nc time.nist.gov 13) ; $a delivers the same time server answer followed by the list of dir & files in the current dir, space separated.

   explicit error $a | hexdump -v -C

2. date command

from the shell or from script : date +%T -s "12:34:56" , properly sets the system time.

via a variable, a=$(date +%T -s "12:34:56") ; $a generates an invalid date "12:34:56"  error

   explicit error : $a 2>&1 | hexdump -v -C

 

Does anyone confirm this behaviour ? Is it documented ? patched ?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines