automatic detect curent useing shell