I want to collect ctime, atime, mtime, and crtime from a considerable mass of files.
As a partial solution, I put the following script:
sudo debugfs -R 'stat <1055890>' /dev/sda1|awk -F': ' -v c='' -v a="" -v m="" 'BENGIN {} $1==" ctime" {c=$2} $1==" atime" {a=$2} $1==" mtime" {m=$2} $1=="crtime" {print c, a, m, $2}'
debugfs 1.42.13 (17-May-2015) 0x5ade9510: c7eb0e9c - Mon Apr 23 23:23:12 2018 0x5b05601f: 111ab67c - Wed May 23 09:35:43 2018 0x5ade9510: c7eb0e9c - Mon Apr 23 23:23:12 2018 0x5ade9510: c7eb0e9c - Mon Apr 23 23:23:12 2018
I want to capture the information as follows:
Mon Apr 23 23:23:12 2018, Wed May 23 09:35:43 2018, Mon Apr 23 23:23:12 2018, Mon Apr 23 23:23:12 2018
Where will be respectively ctime, atime, mtime and crtime in a future csv.
How can I handle the variables to pick up only after "-"?