我试过:
sed -i 's/\n+/\n/' file
Run Code Online (Sandbox Code Playgroud)
但它不起作用。
我仍然想要单行中断。
输入:
abc
def
ghi
jkl
Run Code Online (Sandbox Code Playgroud)
期望的输出:
abc
def
ghi
jkl
Run Code Online (Sandbox Code Playgroud) 如何转义Python字符串中的任何特殊shell字符?
需要转义以下字符:
$,!,#,&,",',(,),|,<,>,`,\,;
Run Code Online (Sandbox Code Playgroud)
比如说我有这个字符串:
str="The$!cat#&ran\"'up()a|<>tree`\;"
Run Code Online (Sandbox Code Playgroud)
TIA
我怎样才能0x1b87像\x1b\x87Python 一样打印?
$ python
Python 2.7.9 (default, Apr 2 2015, 15:33:21)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> hex(0x0d90 ^ 0x1617)
'0x1b87'
Run Code Online (Sandbox Code Playgroud)