Share a solution based on array


  • 3
    W

    Since there already have solutions based on awk or sed or head | tail, here is a unique soluton.

    IFS=$'\n' ;arr=($(<file.txt)); echo ${arr[9]}

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.