Опираясь на количество запятых и возвращаясь к слову, начинающемуся с p / P, вы можете сделать это с помощью "любой" программы регулярных выражений. Например,
grep -E '^([^,]+,){2,2}[^,]+[[:space:]][pP][^[:space:],]+[[:space:]]*,' mytextfile
дает
AABBA, 10050, Tom marc Peter , POR
IIUSA, 10054, Raff paleen , EUS
После множества экспериментов мне удалось решить эту проблему с помощью ZaphodHeads
параметра драйвера Intel, упомянутого в этой ветке сообщений. Рабочая конфигурация:
# Put this in /usr/share/X11/xorg.conf.d/99-dualscreen.conf
Section "Device"
Identifier "Intel0"
Driver "intel"
BusID "PCI:0:2:0"
Screen 0
Option "MonitorDP" "DP1"
Option "ZaphodHeads" "DP1"
EndSection
Section "Device"
Identifier "Intel1"
Driver "intel"
BusID "PCI:0:2:0"
Screen 1
Option "MonitorVGA" "VGA1"
Option "ZaphodHeads" "VGA1"
EndSection
Section "Monitor"
Identifier "MonitorDP"
Option "DPMS"
EndSection
Section "Monitor"
Identifier "MonitorVGA"
Option "DPMS"
EndSection
Section "Screen"
Identifier "Screen0"
Option "AutoServerLayout" "on"
Device "Intel0"
Monitor "MonitorDP"
SubSection "Display"
Viewport 0 0
Depth 24
Modes "1280x1024"
EndSubSection
EndSection
Section "Screen"
Identifier "Screen1"
Option "AutoServerLayout" "on"
Device "Intel1"
Monitor "MonitorVGA"
SubSection "Display"
Viewport 0 0
Depth 24
Modes "1280x1024"
EndSubSection
EndSection
Section "ServerLayout"
Identifier "Multihead"
Option "AutoServerLayout" "on"
Screen 0 "Screen0"
Screen 1 "Screen1"
EndSection
В этой конфигурации экран, подключенный к DisplayPort (DP1
), является основным (DISPLAY=:0.0
), и с ним можно использовать клавиатуру и мышь, тогда как другой дисплей, подключенный к VGA (VGA1
), называется DISPLAY=:0.1
и недоступен. с устройствами ввода.