fork download
  1. # Declare your array first (for context)
  2. my_array=('string' 42 'anotherString' 100 'foo bar' 200)
  3.  
  4. # Prints the last 3 elements in a single line, space-separated
  5. echo "${my_array[@]: -3}"
Success #stdin #stdout 0.01s 5288KB
stdin
Standard input is empty
stdout
100 foo bar 200