Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sed #21

Open
374632897 opened this issue Jul 27, 2017 · 1 comment
Open

sed #21

374632897 opened this issue Jul 27, 2017 · 1 comment

Comments

@374632897
Copy link
Owner

No description provided.

@374632897
Copy link
Owner Author

374632897 commented Jul 27, 2017

Mac 下 sed '\n' 无法换行的问题

换行符的通用写法:

  • echo -e "\n": 使用\n
  • $'\n'

Mac 下在sed命令中使用换行符:

  • 手动换行
    sed -e '1s/^/Hello\
    /p' t.txt
    使用 -e 选项来使手动断行可用。
    image

在 Linux 上要实现上面的效果可以直接sed -i "1i $content" $filename

参考:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant