linux - Bash 脚本操作

标签 linux bash function text find

<分区>

我使用 Bash 脚本,我想通过特殊文本从大文本中获取行

例如我有这些行

first fffffffffffffffffffffffffff
.................................
second ssssssssssssssssssssssssss
.................................
third ttttttttttttttttttttttttttt

我想获取 sssssssssssssssssssssssss 字符串。

谁能帮帮我?

最佳答案

这是你想要的吗?

echo "$longstring" | awk '$1 == "second" { print $2 }'

关于linux - Bash 脚本操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18451950/

相关文章:

linux - SO_TIMESTAMP 和 SO_TIMESTAMPING 软件时间戳的区别

linux - 我需要将一个文件的部分音频添加到另一个文件

python - Linux 上的 Redis 管道崩溃

linux - 如何只在某些字段上执行 awk 命令

c++ - 在 C++ 函数中使用 CURL

r - 将算术运算符视为函数

java - Ubuntu:OpenJDK 8 - 无法找到包

linux - base64 给出不正确的结果

linux - Redis Id 不可读

r - 将用户定义的函数应用于 tibble