Предположим, что файл называется inputfile
, а выходные данные должны храниться в outputfile
:
grep --no-group-separator -A 2 -E \
"group-title=\"TR ULUSAL\"|group-title=\"TR HABER\"|group-title=\"TR BELGESEL\"" \
inputfile > outputfile
Это работает с использованием расширенных регулярных выражений(-E
)и после -контекста(-A
).
Наконец-то я заставил ./configure
работать и смог установить libsocketcan на raspberry pi. Я сделал следующее:
Сначала я нашел этот похожий вопрос . В ответах предлагалось установить autoconf
и automake
и запустить autoreconf -i
. После того, как я сделал это, я мог запустить хотя бы ./configure
, но я получил следующую ошибку:
pi@RPI4:~/Repositorys/libsocketcan-0.0.12 $./configure
checking build system type... armv7l-unknown-linux-gnueabihf
checking host system type... armv7l-unknown-linux-gnueabihf
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
./configure: line 3175: syntax error near unexpected token `win32-dll'
./configure: line 3175: `LT_INIT(win32-dll)'
Я снова запустил autoreconf -i
и внезапно получил другой результат:
src/GNUmakefile.am:1: error: Libtool library used but 'LIBTOOL' is undefined
src/GNUmakefile.am:1: The usual way to define 'LIBTOOL' is to add 'LT_INIT'
src/GNUmakefile.am:1: to 'configure.ac' and run 'aclocal' and 'autoconf' again.
src/GNUmakefile.am:1: If 'LT_INIT' is in 'configure.ac', make sure
src/GNUmakefile.am:1: its definition is in aclocal's search path.
autoreconf: automake failed with exit status: 1
Быстрый поиск ошибки предложил установить libtool с sudo apt-get install libtool
. Я сделал это и снова запустил autoreconf -i
. После этого./configure наконец заработал.