1
我有一个ssh
命令,它给出了下面的输出,我希望ssh
命令的ssh命令的输出进行修改,使得url
和jirano
输出来并排如果有jirano
,第二变化的确没有jirano
..我有下面的预期输出..可以这样做使用awk
或grep
或cut
?解析用awk
ssh -p 29418 review-android.company.com gerrit query --current-patch-set \
--commit-message 'platform/vendor/qcom-opensource/data/code branch:bj_5.2 label:Verified=-1'
输出
change I739c56305aed3da40132253cf66bce4d315f73 project: platform/vendor/qcom-opensource/data/code branch: bj_5.2 id: I739c56305aed3da40132253cf66bce4d315f73 url: https://review-android.company.com/12345 commitMessage: data: test this is an experiment driver. Since none of the definitions in this file are actually being used today, remove the file and all references to it. jirano: 470101 createdOn: 2013-04-18 13:17:05 PDT lastUpdated: 2013-04-18 17:21:54 PDT change I739c56305aed3da401a5323cf66bce4d315f73 project: platform/vendor/qcom-opensource/data/code branch: bj_5.2 id: I739c56305aed3da401a532253cf66bce4d315f73 url: https://review-android.company.com/67899 commitMessage: test1 this is an test donot experiment used today, createdOn: 2013-04-18 13:17:05 PDT lastUpdated: 2013-04-18 17:21:54 PDT
预计输出
https://review-android.company.com/12345 470101 https://review-android.company.com/67899
我不认为这是工作......我看到的网址越来越打印在没有“jirano”的情况下并排编辑 – user2125827
如何使jirano不区分大小写@'/ url | jirano/{print $ 2}' – user2125827
冒号后可能有或没有空格(:)“ jirano:470101“..当冒号后没有空格时,当前命令搞乱了(:) – user2125827