Главная страница


ru.linux

 
 - RU.LINUX ---------------------------------------------------------------------
 From : Alexandr S. Agranovsky               2:5020/400     20 Dec 2002  08:09:55
 To : Ilya Evseev
 Subject : Re: reading text file using bash: cannot skip comments
 -------------------------------------------------------------------------------- 
 
 
 
   Hi, Ilya Evseev
 
 IE> while read line; do
 IE>     ...
 IE> done < file.txt
 IE> Вопрос: как игнорировать строки, начинающиеся с "#" ?
 
 ...
 
 IE> Существует ли решение?
 
 У меня с полпинка заработал вариант:
 while read line
 do
   [ "`echo "$line" | cut -f1 -d'#'`" = "" ] && continue
   echo "$line"
 done <file.txt
 
 - ---
 Alexandr S. Agranovsky llb@udmnet.ru
 --- ifmail v.2.15dev5
  * Origin: LLB, LLC (2:5020/400)
 
 

Вернуться к списку тем, сортированных по: возрастание даты  уменьшение даты  тема  автор 

 Тема:    Автор:    Дата:  
 reading text file using bash: cannot skip comments   Ilya Evseev   20 Dec 2002 03:29:24 
 Re: reading text file using bash: cannot skip comments   Alexandr S. Agranovsky   20 Dec 2002 08:09:55 
 reading text file using bash: cannot skip comments   Vickenty Fesunov   21 Dec 2002 01:25:17 
 reading text file using bash: cannot skip comments   Roman Lagunov   21 Dec 2002 17:59:18 
 Re: reading text file using bash: cannot skip comments   Aleksey Cheusov   24 Dec 2002 18:22:50 
 reading text file using bash: cannot skip comments   Roman Lagunov   24 Dec 2002 22:07:33 
 Re: reading text file using bash: cannot skip comments   Ian Dichkovsky   03 Jan 2003 14:05:20 
 book - Unix programming environment - Was ( Re: reading text )   Ian Dichkovsky   03 Jan 2003 16:59:32 
 reading text file using bash: cannot skip comments   Kirill Frolov   21 Dec 2002 09:23:54 
Архивное /ru.linux/36425a560e22.html, оценка 1 из 5, голосов 10
Яндекс.Метрика
Valid HTML 4.01 Transitional