2
I made a command in linux that saves in a txt the output of the terminal from time to time, in case the output of the command free -m, I wanted to read that file. txt so that javascript would update the values periodically without having to reload the page, in case the return of the terminal would be something like:
total used free shared buff/cache available
Mem: 2004 998 155 231 850 511
Swap: 4000 0 4000
Wanted Script to pick up saved texts in a type array
Array[0] = "total used free Shared Buff available"
Array[1] = "Mem: 2004 998 155 231 850 511"
Array[2] = "Swap: 4000 0 4000"
'Cause after that I’d use the Array[1]. split(" ") to separate into another array containing each of the memory values and the Array[2]. split(" ") containing each of the swap values