Sort by

recency

|

152 Discussions

|

  • + 0 comments

    IFS="\t" while read line do echo $line | cut -f 1-3 done

  • + 0 comments

    while read c do echo "$c" | cut -f1-3 done

  • + 0 comments
    for (( i=0; i<100; i++ )); do
      read line
      if [[ -n ${line} ]]; then
        echo ${line} | cut -f 1-3 -d $'\t' -s
      fi
    done;
    

    This is not working for me? I'm not sure why? It works o my local machine and it even follows the suggestion in the editoriral. I can see others have passed the test so not sure what's happening. Thanks in advance.

  • + 0 comments

    as the tab is the default delimiter of cut. so you can use:

    cut -f1-3
    
  • + 0 comments

    echo "$(cut -f 1-3)"