Reputation: 5505
What is the right way to cut columns and print some of them multiple times in the output:
cut -d " " -f1,3,3,4 in > out
does not work.
Upvotes: 1
Views: 844
Reputation: 6911
Bash
OLDIFS="$IFS"
while read -r line
do
set -- $line
echo "$1 $3 $3 $5"
done <file
IFS="$OLDIFS"
Upvotes: 1