Date: 05/21/06 (Code WTF) Keywords: php Редкой, практически незаметной. for /f "usebackq tokens=1,2" %%i in (`php -r "echo '1 '.trim(shell_exec('ipconfig /all'.chr(124).'find '.chr(34).'DNS'.chr(34).chr(124).'sed '.chr(34).'s/ \.//g;s/[^0-9\.]//g'.chr(34))); echo chr(10).'2 '; $a = trim(shell_exec('ipconfig /all'.chr(124).'grep -e '.chr(34).'^ *[0-9][0-9\.]*$'.chr(34).chr(124).'sed '.chr(34).'s/ //g'.chr(34))); echo ($a == '' ? '127.0.0.1' : $a);"`) do php -r "system('cat tdifw.conf%%i'.chr(124).'sed '.chr(34).'s/CUR_DNS%%i=[0-9\.]*/CUR_DNS% Source: http://community.livejournal.com/code_wtf/38832.html
|