How to split log.txt into timeline.txt and action.txt using the shortest bash one-line command?
tee <log.txt >(cut -d' ' -f1 >timeline.txt) >(cut -d' ' -f2- >action.txt)
But it’s too long, and duplication of cut.
log.txt
[00:00] Do A
[02:24] Do B
[16:12] Do C
... ...
timelime.txt
[00:00]
[02:24]
[16:12]
... ...
action.txt
Do A
Do B
Do C
... ...
You want to use
cut:I’m assuming that you have a single space after the “]” and that you’re on a Unix-ish system.