Sort by

recency

|

53 Discussions

|

  • + 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;
    
  • + 1 comment

    i understand that "-d" must be used, but why just "cut -f 1-3" doesn't work like it worked previously?