I'm trying to put my grep output lines into an array as elements.
The output after grep (files are stored in /asd folder for example)
test.mp4
test2.mp4
So here's how it should be at the end:
arr_name[0] = test.mp4
arr_name[1] = test2.mp4
Here's my code so far:
arr_name=( $(cd ~/asd; ls -tr | grep -v total | head -2) )
Can you please help me to resolve the mistake?