Как удалить определенный шаблон из определенных строк с помощью bash

fijo:

thufir@bot:~$ 
thufir@bot:~$ iwconfig
lo        no wireless extensions.

wls4      IEEE 802.11  ESSID:"dfskflsdj"  
          Mode:Managed  Frequency:2.462 GHz  Access Point: C0:3F:0E:8B:4D:04   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:on

ens5      no wireless extensions.

thufir@bot:~$ 

historial de comandos:

   14  sudo lspci
   15  spci -vnn | grep -i net 
   16  sudo lspci -vnn | grep -i net 
   17  sudo lshw -C net
   18  iwconfig
   19  sudo apt install wireless-tools
   20  iwconfig
   21  sudo  apt install firmware-b43-installer
   22  iwconfig
   23  sudo apt-get install bcmwl-kernel-source
   24  iwconfig

no estoy muy seguro de si se trataba de una instalación específica o si se requerían todas --pero funciona.

0
22.06.2019, 19:25
2 ответа

Как сказал @steeldriver, вам нужно использовать 4 обратных слэша, чтобы они правильно экранировались, вот так:VAR="\\\\textcolor{red}{". Ваша команда sedдолжна работать без каких-либо изменений. Кроме того, вы неправильно написали «текстовый цвет».

1
28.01.2020, 02:40

Протестировано с приведенной ниже командой awk, все работает нормально

awk 'NR==1||3{gsub(/\\textcolor{red}/,"",$0);print $0}' filename

выход

\ParallelLText{\jverse{5}{“Ahut isi inut chili kerik abang chili rik damlo. Alangli chili kerik ahut penang achili ke tovar akungsi klolo, lapen la aphan dongpon long-lo lapen nampi avo atum vangsi chongthok-et-lo.}}{\jverse{5}{“A sower went out to sow his seed; and as he sowed, some fell on the path and was trampled on, and the birds of the air ate it up.}}
 \ParallelLText{\jverse{6}{Lapen akaprek achili ke longpak athak klolo, lapen lake kechingjok pen mamat chekedulo, pima hadak longle kecham avedet-lo.}}{\jverse{6}{Some fell on the rock; and as it grew up, it withered for lack of moisture. }}
 \ParallelLText{\jverse{7}{Akaprek achili ke ingsu kethe arong ajosi klolo, lapen ingsu kethe arong la pen the rap-rapsi la aphan petthip-lo.}}{\jverse{7}{Some fell among thorns, and the thorns grew with it and choked it.}}
 \ParallelLText{\jverse{8}{Jisu halatum aphan thak-lo, “Arnam Arat akepatu alam kechiniji, lake nangtum aphan nangpitang-lo, bonta akaprek atum aphan ke lamlir pensi thanlo. Lasi latum thek longbom setta thek longledetji lapen arjubom setta chini nedetji.” }}{\jverse{8}{He said, “To you it has been given to know the secrets of the kingdom of God; but to others I speak in parables, so that‘looking they may not perceive, and listening they may not understand.’}}
 \ParallelLText{\jverse{9}{“Bonta Lamlir athe lahelo: Chili ke Arnam alamlo.}}{\jverse{9}{“Now the parable is this: The seed is the word of God.}}
 \ParallelLText{\jverse{10}{Tovar akung keklo achili ke karjulong atumlo; latum kroikredetsi kejok kelongledetji aphan Diabol vangsi halatum aning arlo pen alam pondet-lo.}}{\jverse{10}{The ones on the path are those who have heard; then the devil comes and takes away the word from their hearts, so that they may not believe and be saved.}}

правин@правин :~$

0
28.01.2020, 02:40

Теги

Похожие вопросы