HF RL Explorer

Task: Creating an Array from a Text File in Bash

Task: Creating an Array from a Text File in Bash: a task in Terminal-Lego-15k (Harbor dataset). You need to write a Bash script that reads a text file where each line contains a multi-word string, and stores each complete line as a single element in an array. The script should then iterate through…

The task

You need to write a Bash script that reads a text file where each line contains a multi-word string, and stores each complete line as a single element in an array. The script should then iterate through the array and print each element with its index.

Part of PrimeIntellect/Terminal-Lego-15k.