curl - 如何在 sed 上通过tipe grep 任何值
问题描述
我有一些价值观:
hybrisServer-Platform-1.1.2275-develop.zip
hybrisServer-Platform-1.1.2273-saphana-develop.zip
hybrisServer-Platform-1.1.2274-saphana-develop.zip
hybrisServer-Platform-1.1.2275-develop.zip
hybrisServer-Platform-1.1.2276-saphana-develop.zip
hybrisServer-Platform-1.1.2277-develop.zip
hybrisServer-Platform-1.1.2278-saphana-develop.zip
我如何才能grep
仅使用(没有 saphana-develop)进行构建,例如:
hybrisServer-Platform-1.1.2277-develop.zip
此表达式仅写入文件 hybrisServer-Platform-1.1.2278-saphana-develop.zip
$ curl -s http://<ip address>:8081/artifactory/hybris-snapshot-local/| sed -rn "s/.*Platform-(.*\develop.*)\.zip.*/\1/p" | sort | grep develop | tail -1 | tr -d "\n" > /opt/test1.out
解决方案
请更改 grep 表达式,因为grep -v saphana-develop | tail -1
它只会打印最后修改过的没有 saphana-develop
推荐阅读
- angular - 如果单击Angular中的其他按钮,如何在单击时禁用按钮并再次启用它
- java - Constraint Layout not working; the layout is destroyed across devices
- php - PHP 中没有 Windows 任务计划程序的灵活任务计划程序
- csv - powershell - 如何使用 csv 自动添加和删除 dhcp 预留
- django - Django不同模型的相同权限集
- ruby-on-rails - 如何使用 form_with 为选择菜单添加“任何”选项
- c - 为什么编译器在将要初始化的指针可能未初始化并且指针不会更新时发出警告?
- css - 更改输入背景颜色不起作用
- spring-boot - 无法使用 th:each 属性在 thymeleaf 中呈现字符串数组
- linux - 无法写入“-”(管道损坏)