Search Results

Search: Posts Made By: piynik
2,508
Posted By Jotne
var=$(awk 'NR<3{next} NF==0{exit} 1'...
var=$(awk 'NR<3{next} NF==0{exit} 1' textfile.txt)
2,508
Posted By Scrutinizer
Quick fix: awk NR==2 RS= textfile.txt | while...
Quick fix:
awk NR==2 RS= textfile.txt |
while read var
do
echo "$var"
done
3,840
Posted By DGPickett
Yes, "while read" is a keeper, pipeline parallel...
Yes, "while read" is a keeper, pipeline parallel and robust. Read can capture fields, and bash has "read -a simple_array_var_typedef_-a" so you do not even have to count or name them. I mostly use...
2,337
Posted By RudiC
You want to leave out the switching line - so...
You want to leave out the switching line - so switch off before print and switch on after print.
I don't see a reason why it should not work on a single line except that awk might have difficulties...
Showing results 1 to 4 of 4

 
All times are GMT -4. The time now is 09:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy