跳转

5年以前  |  阅读数:491 次  |  编程语言:Shell 
#!/bin/bash

#跳转到指定脚本
sed '{/first/b jump1; s/This is the/No jump on/; :jump1; s/This is the/Jump here on/}' test

#跳转到开头,删除每一个逗号,并保证删除最后一个逗号之后,跳出循环
sed -n '{:start; s/,//1p; /,/b start}' test

Copyright© 2013-2020

All Rights Reserved 京ICP备2023019179号-8