如何使用 bash linux 搜索 xml 标签
我没有 xml carlet 只是 bash,我必须只在 bash 中实现。 我有 xml 格式的标签 hh,它是来自肥皂项目的响应。我必须验证/检查响应是否具有以下 xml 标记。如果是,则“不执行任何操作”,否则“通过触发电子邮件通知收件人。
tag=<name>h</name> <name>h</name>
if [[$tag == "<name>h</name> <name>h</name>"]]; then "nothing" else "something" fi ->didnt work
if [["$tag" == "<name>h</name>\n<name>h</name>"]]; then "nothing" else "something" fi -->didnt work either.
使用 grep 、awk 无法实现它。标记不是文件它只是字符串 请帮忙
I dont have xml scarlet just bash and i have to acheive in bash only.
i have the tag h h in xml format that is the response from a soap project. i have to validate/check if the response have the below xml tag.if yes then do "nothing" else "notify the recipients by triggering an email.
tag=<name>h</name> <name>h</name>
if [[$tag == "<name>h</name> <name>h</name>"]]; then "nothing" else "something" fi ->didnt work
if [["$tag" == "<name>h</name>\n<name>h</name>"]]; then "nothing" else "something" fi -->didnt work either.
used grep ,awk what wasn't able to achieve it. tag is not a file its just the string
please help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)