improve shell client for old bourne-shell(on FreeBSD) compatible