Sort by

recency

|

54 Discussions

|

  • + 0 comments
    IFS=$' '
    while read w1 w2 w3 _
    do
    printf "%s %s %s\n" $w1 $w2 $w3
    done
    
  • + 0 comments

    another way to solve the problem using only read function

    while IFS=' ' read -r -a line;do
        echo "${line[0]} ${line[1]} ${line[2]}"
    done
    
  • + 0 comments

    Simple Code

    while read line;
    do
        echo ${line} | awk '{print $1, $2, $3}'
    done
    
  • + 0 comments

    Solution with awk:

    while read line;
    do
        echo ${line} | awk '{print $1, $2, $3}'
    done
    
  • + 0 comments
    while read line;
    do
        echo "$line" | cut -d " " -f 1-3;
    done;