我有一個包含id命令的詳細信息的文件test.txt(如:id sudi
)如何搜索特定羣體用戶屬於
uid=23351(sudi) gid=5000(bns) groups=5000(bns),16382(damepgrp),15657(edl_prd_rcrr_sup),15650(edl_prd_rcrr_user),15712(edl_prd_yarn_int_cb),15721(edl_prd_yarn_int_rsk),15632(edl_prod_rcam_admin),16110(edlp_bc5m_sup)
uid=23458(achung1) gid=5000(bns) groups=5000(bns),15757(edl_prd_ice_analyst),15483(edl_prd_ice_user),15650(edl_prd_rcrr_user),15712(edl_prd_yarn_int_cb),15721(edl_prd_yarn_int_rsk)
uid=19831(afabia) gid=5000(bns) groups=5000(bns),15774(edl_prd_c360da_users),15714(edl_prd_yarn_int_ana),15712(edl_prd_yarn_int_cb),15606(edl_prod_c360_users),16179(edl_prod_c360rt_users),15621(edl_prod_dspm_dev),16076(edlp_bc4g_ca_ez_usr),16052(edlp_bc4g_ca_usr),16053(edlp_c360_da_usr),15105(hdpcmo),15104(hdpnanalytics),15279(hdpnaug),15144(rscmo),15280(rsnaug),16171(edl_prod_c360rt_susr)
如何打印唯一的ID和絲羣作爲輸出。我已經使用grep嘗試過和sed,但沒有運氣 如:
sudi: edl_prd_yarn_int_ana, edl_prd_yarn_int_cb
achung1: edl_prd_yarn_int_cb, edl_prd_yarn_int_rsk
afabia: edl_prd_yarn_int_cb, edl_prd_yarn_int_ana
將紗線信息總是被包裹在雙星號? – JNevill
沒有我剛纔強調了id命令的問題目的輸出如下:UID = 23351(abotha)GID = 5000(BNS)基團= 5000(BNS),16382(damepgrp),15657(edl_prd_rcrr_sup),15650(edl_prd_rcrr_user ),15712(edl_prd_yarn_int_cb),15721(edl_prd_yarn_int_rsk),15632(edl_prod_rcam_admin),16110(edlp_bc5m_sup) –