working autocomplete version based on bash script