better prgram usage
update test.sh
fix bug in magic code recognition