我現在有Python的-c開關
".".join(str(z) for z in [int(x, 16) for x in (re.sub(r'(.{2})(?!$)', r'\1.', "00112233")).split('.')])
'xx.xx.xx.xx'
其工作,但是當我嘗試通過Python來使用它-c開關失敗?
[[email protected] ~]# python -c "import re ; ".".join(str(z) for z in [int(x, 16) for x in (re.sub(r'(.{2})(?!$)', r'\1.', "00112233")).split('.')])"
python -c "import re ; ".".join(str(z) for z in [int(x, 16) for x in (re.sub(r'(.{2})(?"import re ; ".".join(str(z) for z in [int(x, 16) for x in (re.sub(r'(.{2})(?python)', r'\1.', "00112233")).split('.')])")', r'\1.', "00112233")).split('.')])"
-bash: syntax error near unexpected token `str'
任何想法?
轉義的雙引號雙引號內.. – 2013-04-05 13:35:20