почему firewalld добавляет порт и список IP-адресов не работает должным образом

Как насчет того, чтобы позволить readсделать разделение за вас, установив разделитель полей на .?

while IFS=. read -r first_element remainder; do 
  echo myprogram -i "../$first_element" -o "../${first_element}.${remainder}"
done < ListOfDotSeparatedPhrases.txt 
myprogram -i../18T3L -o../18T3L.fastqAligned.sortedByCoord.out.bam
myprogram -i../35T10R -o../35T10R.fastqAligned.sortedByCoord.out.bam
myprogram -i../18T6L -o../18T6L.fastqAligned.sortedByCoord.out.bam
myprogram -i../40T4LAligned -o../40T4LAligned.sortedByCoord.out.bam
myprogram -i../22T10L -o../22T10L.fastqAligned.sortedByCoord.out.bam
myprogram -i../38T7L -o../38T7L.fastqAligned.sortedByCoord.out.bam

Изman bash:

read [-ers] [-a aname] [-d delim] [-i text] [-n nchars] [-N nchars] [-p
       prompt] [-t timeout] [-u fd] [name...]
              One line is read from the  standard  input,  or  from  the  file
              descriptor  fd  supplied  as an argument to the -u option, split
              into words as described above  under  Word  Splitting,  and  the
              first word is assigned to the first name, the second word to the
              second name, and so on.  If there are more words than names, the
              remaining words and their intervening delimiters are assigned to
              the last name.  If there are fewer words  read  from  the  input
              stream  than  names, the remaining names are assigned empty val‐
              ues.  The characters in IFS are used  to  split  the  line  into
              words  using  the  same  rules  the  shell  uses  for  expansion
              (described above under Word Splitting).

В качестве альтернативы (на самом деле это проще -и более переносимо )читать и сохранять всю строку,затем используйте расширение параметра оболочки, чтобы сгенерировать первый элемент, удалив остаток:

while read -r x; do 
  myprogram -i "../${x%%.*}" -o "../$x"
done < ListOfDotSeparatedPhrases.txt
0
10.05.2021, 11:11
1 ответ

расширить диапазон IP-адресов:

firewall-cmd --zone=special --add-source=61.173.91.1/24 --permanent

работает.

0
28.07.2021, 11:33

Теги

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