![yum 명령 출력에서 - 또는 더하기로 시작하는 grep 행](https://rvso.com/image/168790/yum%20%EB%AA%85%EB%A0%B9%20%EC%B6%9C%EB%A0%A5%EC%97%90%EC%84%9C%20%E2%80%8B%E2%80%8B-%20%EB%98%90%EB%8A%94%20%EB%8D%94%ED%95%98%EA%B8%B0%EB%A1%9C%20%EC%8B%9C%EC%9E%91%ED%95%98%EB%8A%94%20grep%20%ED%96%89.png)
yum 쿼리를 실행 중입니다.
yum group info 'X Window System'
출력은 다음과 같습니다
yum group info 'X Window System'
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirror.vanehost.com
* extras: mirror.vanehost.com
* updates: mirror.vanehost.com
Group: X Window System
Group-Id: x11
Description: X Window System Support.
Mandatory Packages:
-glx-utils
-initial-setup-gui
=mesa-dri-drivers
=plymouth-system-theme
=spice-vdagent
+xorg-x11-drivers
=xorg-x11-server-Xorg
=xorg-x11-utils
=xorg-x11-xauth
=xorg-x11-xinit
=xvattr
Optional Packages:
mesa-libGLES
tigervnc-server
wayland-protocols-devel
xorg-x11-drv-evdev
xorg-x11-drv-keyboard
xorg-x11-drv-libinput
xorg-x11-drv-mouse
xorg-x11-drv-openchrome
하지만 내가 - 또는 +로 시작하는 줄을 필터링하기 위해 grep을 실행할 때마다
yum group info 'X Window System' | grep -E "^[-+]"
빈 출력이 나타납니다. 어떤 사람이 내가 어디로 잘못 가고 있는지 알려줄 수 있습니까?
답변1
줄은 +
또는 로 시작하지 않고 -
공백으로 시작합니다. 노력하다
grep -E "^[[:blank:]]*[-+]"