Artificial intelligent assistant

Bash script/awk to input and output a CSV file I'm having some trouble creating a bash/awk/sed script that would take a comma-separated CSV file of three columns (firstname, lastname, date of birth), and outputs another CSV file that has the same columns from input with an additional column that shows the difference between the current date and the date of birth in years. $ yourscript <input CSV file> <output CSV file> * `input.csv` may look like this: bob,wag,06/13/1958 ashley,hay,01/23/1983 evan,bert,09/11/1972 * `output.csv` should look like this: bob,wag,06/13/1958,62 ashley,hay,01/23/1983,37 evan,bert,09/11/1972,48

$ cat data
bob,wag,06/13/1958
ashley,hay,01/23/1983
evan,bert,09/11/1972


To output in a file named `output-file` and display to STDOUT at the same time:


$ awk -v year="$(\date +%Y)" 'BEGIN{FS="/"} {print $0 "," year-$3}' data | tee output-file
bob,wag,06/13/1958,62
ashley,hay,01/23/1983,37
evan,bert,09/11/1972,48


Or to just output to the same file:


$ awk -v year="$(\date +%Y)" 'BEGIN{FS="/"} {print $0 "," year-$3}' data > output-file

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy d62ee7d6673dd72f49dfb81f2658c3e9