Print last position of a splitted string with AWK
I know this is quite easy but I admit I had to look up in google cause I didn’t know awk had lenght function.
#!/bin/bash
STRING="some,thing,is,splitting,here";
echo $STRING | awk '{split($0,a,","); print a[length(a)]}';