Last active
December 28, 2019 04:13
-
-
Save hanminghui/5e6148ad5527bf01925701d002d38b08 to your computer and use it in GitHub Desktop.
[sed_scripts] some sed scripts examples #sed #linux #shell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # replace blank line, even line contains spaces | |
| s/^ *$/.LP/ | |
| # replace spaces at begin of the line | |
| s/^ *// | |
| # replace spaces at end of the line | |
| s/ *$// | |
| # replace spaces more than one to just one space | |
| s/ */ /g | |
| # extract outline from latex files | |
| sed -n ' | |
| s/[{}]//g | |
| s/\\section/ A. /p | |
| s/\\subsection/ B. /p' $* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment