Sort by

recency

|

94 Discussions

|

  • + 0 comments

    To display an element of an array, you can access it using its index, with array indexing starting at 0. For example, console.log(array[2]); will display the third element in the array. Ensure that the index is within the bounds of the array to avoid errors. Cricbet99

  • + 0 comments

    My solution> #!/bin/bash

    array=()

    while read -r entrada || [ -n "entrada") done

    echo ${array[3]}

  • + 0 comments
    counter=0
    while read -r line;do
        counter=$((counter+1))
        if [ $counter == 4 ];then
            echo "$line"
            break
        fi
        
    done
    
  • + 1 comment
    awk 'NR==4 {print}'
    
  • + 1 comment
    readarray array
    echo ${array[3]}
    
    readarray array
    echo ${array[@]:3:1}