lists:last? Also, maybe a function here replacing the inner-part might be nice. Naming what it's doing helps to understand (although I know it's just extracting the config file name from running chkconfig)