Answer the question
In order to leave comments, you need to log in
How to assign variables to some words of a string in a bash loop?
Good afternoon!
Sometimes you need to pull out some words from the lines of a file, usually I do it like this:
cat ./file | while read line; do
f=`echo "$line" | cut -f1 -d":"`
s=`echo "$line" | cut -f2 -d":"`
t=`echo "$line" | cut -f3 -d":"`
done
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question