当我cat
或sed
一个iOS可执行文件时,它总是中断,我得到以下消息:
$ 1;2c1;2c1;2c1;2c1;2c1;2c1;2c1;2c1;2c1;2c1;2c
当我按回车键时,我得到:
$ 1;2c1;2c1;2c1;2c1;2c1;2c1;2c1;2c1;2c1;2c1;2c
-bash: 1: command not found
-bash: 2c1: command not found
-bash: 2c1: command not found
-bash: 2c1: command not found
-bash: 2c1: command not found
-bash: 2c1: command not found
-bash: 2c1: command not found
-bash: 2c1: command not found
-bash: 2c1: command not found
-bash: 2c1: command not found
-bash: 2c1: command not found
-bash: 2c: command not found
最佳答案
只要您不向终端输出任何二进制内容,它就应该可以工作。制作副本并使用sed -i
就地修改副本:
cp file file.modified
sed -i 's/pattern/replacement/' file.modified
然后使用例如
vimdiff
来验证更改(在使用fold
将新行放入文件之后):fold -w40 file > file.40
fold -w40 file.modified > file.modified.40
vimdiff file.40 file.40
关于linux - cat/sed一个iOS可执行文件-macOS上的错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/41733442/