I have this simple script :
#!/bin/bash
dates_and_PID=$(ps -eo lstart,pid)
echo ${dates_and_PID::24}
And I would like each line to be cut at the 24th character. Nevertheless, it considers the variable dates_and_PID
as a single line, so I only have one line that is generated. Whereas I would like it to be cut for each line.
I am practicing but the final goal would be to have the script change the dates from Mon Nov 11 2020
to 11/11/20
.