Я пытаюсь разобрать вывод pacman -Qi, это выглядит примерно так:
Name : zvbi
Version : 0.2.35-3
Description : VBI capture and decoding library
Build Date : Fri 24 Aug 2018 09:48:59 CEST
Install Date : Thu 30 Aug 2018 08:55:50 CEST
Install Reason : Installed as a dependency for another package
Install Script : No
Validated By : Signature
Name : zziplib
Version : 0.13.69-1
Description : A lightweight library that offers the ability to easily extract data from files archived in a single zip file
Build Date : Wed 21 Mar 2018 21:16:20 CET
Install Date : Thu 22 Mar 2018 11:13:19 CET
Install Reason : Installed as a dependency for another package
Install Script : No
Validated By : Signature
Мне нужно разобраться в этом:
zvbi VBI capture and decoding library
zziplib A lightweight library that offers the ability to easily extract data from files archived in a single zip file
Пробелы являются символами табуляции
Прямо сейчас я попытался разобрать это:
pacman -Qi | awk -F: '/^Name/ {n=$2} /^Desc/ {d=$2} {print n "\t" d}'
Но выводит это
zvbi
zvbi
zvbi VBI capture and decoding library
zvbi VBI capture and decoding library
zvbi VBI capture and decoding library
zvbi VBI capture and decoding library
zvbi VBI capture and decoding library
zvbi VBI capture and decoding library
zvbi VBI capture and decoding library
zvbi VBI capture and decoding library
zvbi VBI capture and decoding library
zvbi VBI capture and decoding library
zvbi VBI capture and decoding library
zvbi VBI capture and decoding library
zvbi VBI capture and decoding library
zvbi VBI capture and decoding library
zvbi VBI capture and decoding library
zvbi VBI capture and decoding library
zvbi VBI capture and decoding library
zvbi VBI capture and decoding library
zvbi VBI capture and decoding library
zvbi VBI capture and decoding library
zziplib VBI capture and decoding library
zziplib VBI capture and decoding library
zziplib A lightweight library that offers the ability to easily extract data from files archived in a single zip file
zziplib A lightweight library that offers the ability to easily extract data from files archived in a single zip file
zziplib A lightweight library that offers the ability to easily extract data from files archived in a single zip file
zziplib A lightweight library that offers the ability to easily extract data from files archived in a single zip file
zziplib A lightweight library that offers the ability to easily extract data from files archived in a single zip file
zziplib A lightweight library that offers the ability to easily extract data from files archived in a single zip file
zziplib A lightweight library that offers the ability to easily extract data from files archived in a single zip file
zziplib A lightweight library that offers the ability to easily extract data from files archived in a single zip file
zziplib A lightweight library that offers the ability to easily extract data from files archived in a single zip file
zziplib A lightweight library that offers the ability to easily extract data from files archived in a single zip file
zziplib A lightweight library that offers the ability to easily extract data from files archived in a single zip file
zziplib A lightweight library that offers the ability to easily extract data from files archived in a single zip file
zziplib A lightweight library that offers the ability to easily extract data from files archived in a single zip file
zziplib A lightweight library that offers the ability to easily extract data from files archived in a single zip file
zziplib A lightweight library that offers the ability to easily extract data from files archived in a single zip file
zziplib A lightweight library that offers the ability to easily extract data from files archived in a single zip file
zziplib A lightweight library that offers the ability to easily extract data from files archived in a single zip file
zziplib A lightweight library that offers the ability to easily extract data from files archived in a single zip file
zziplib A lightweight library that offers the ability to easily extract data from files archived in a single zip file
zziplib A lightweight library that offers the ability to easily extract data from files archived in a single zip file
И использование uniq дает это
zvbi
zvbi VBI capture and decoding library
zziplib VBI capture and decoding library
zziplib A lightweight library that offers the ability to easily extract data from files archived in a single zip file
Обратите внимание на пробел в начале каждой строки.
Я думаю, что это можно сделать, проверив состояние переменных n и d, напечатав их, когда они оба установлены, затем очистив их, но я не уверен, как это сделать.