bash - Variables from file -


a text file has following structure:

paa pee pii poo puu baa bee bii boo buu gaa gee gii goo guu maa mee mii moo muu 

reading line line in script done

while read line;      action done < file 

i'd need parameters 3 , 4 of each line variables action. if manual input, $3 , $4 trick. assume awk tool, can't wrap head around syntax. halp?

read fine. pass multiple variables , split on $ifs many fields.

while read -r 1 2 3 4 five;     action "$three" "$four" done <file 

i added -r option because want. default behavior legacy oddity of limited use.


Comments

Popular posts from this blog

C# random value from dictionary and tuple -

cgi - How do I interpret URLs without extension as files rather than missing directories in nginx? -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -