Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
#!/bin/bash
IFS='
'
exec 3<>data.txt
while read -u 3 line
do
(
IFS=' '
result=()
for word in $line
do
&& result=(${result[*]} $word)
done
echo ${result[*]}
)
done
If the order in the string is not important, then you can simply
while read;do echo $REPLY|xargs -n1|sort -u|xargs; done<data.txt
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question