the output of my command is:
scan: DVD has 6 title(s)
...some text...
+ title 1:
...some text...
+ duration: 00:43:12
...some text...
+ title 2:
...some text...
+ duration: 00:43:12
...some text...
+ title 3:
...some text...
+ duration: 00:41:15
i want to have var for:
6 from scan: DVD has 6 title(s)
1 from + title 1:
00:43:12 from + duration: 00:43:12
not that the two last one are linked, maybe use an array For title and duration title[1]="00:43:12"
actually i'm only able to extract one information at a time but i don't want to run the command multiple time if possible. for example:
[command] |& grep -Po '(?<=DVD has )([0-9]+)')
maybe i should store the command output to a file first? what is the best way to start please ?
bash(and shell in general) is not really meant for data processing; it's meant for process control and file handling.