庆典得到字符后的字符串 [英] bash get string after character

查看:166
本文介绍了庆典得到字符后的字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个字符串,它看起来像这样:

  GenFiltEff = 7.092200e-01

使用bash,我想只得到=字符后的数字。有没有办法做到这一点?


解决方案

 切-d=-f 2';<< $ your_str

 的sed -e的#* = \\(\\)#\\ 1#。'<<< $ your_str

I have a string that looks like this:

 GenFiltEff=7.092200e-01

Using bash, I would like to just get the number after the = character. Is there a way to do this?

解决方案

cut -d "=" -f 2 <<< "$your_str"

or

sed -e 's#.*=\(\)#\1#' <<< "$your_str"

这篇关于庆典得到字符后的字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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