Solaris sed 标签太长 [英] Solaris sed label too long

查看:28
本文介绍了Solaris sed 标签太长的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试执行一个 shell 文件,其中有一行:

I am trying to execute a shell file, in which there is a line:

sed -ne ':1;/PinnInstitutionPath/{n;p;b1}' Institution | sed -e s/\ //g | sed -e s/\=//g | sed -e s/\;//g | sed -e s/\"//g | sed -e s/\Name//g

结果是错误信息:"Label too long: :1;/PinnInstitutionPath/{n;p;b1}"

我是Linux的菜鸟,谁能帮我解决这个问题,谢谢!

I am a noob at linux, so can anyone help me to solve this problem, thank you!

推荐答案

尝试更改

sed -ne ':1;/PinnInstitutionPath/{n;p;b1}'

sed -ne ':1' -e '/PinnInstitutionPath/{n;p;b1}'

另外,你不需要多次调用sed:

Also, you don't need to call sed so many times:

sed -ne 's/[ =;"]//g; s/Name//g' -e ':1' -e '/PinnInstitutionPath/{n;p;b1}'

这篇关于Solaris sed 标签太长的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆