【讨论】判断某个字符串以字符开头

【讨论】判断某个字符串以字符开头

请教下,在shell脚本中如何判断一个字符串是以字符开头,如:test001      
复制内容到剪贴板
代码:
[color=blue]-(user@host:tty)-(tmp)-
[4181 0] $ [/color]var=123
[color=blue]-(user@host:tty)-(tmp)-
[4181 0] $ [/color]if [[ $var == [a-zA-Z]* ]]; then echo yes; else echo no; fi
no
[color=blue]-(user@host:tty)-(tmp)-
[4181 0] $ [/color]var=helloworld
[color=blue]-(user@host:tty)-(tmp)-
[4181 0] $ [/color]if [[ $var == [a-zA-Z]* ]]; then echo yes; else echo no; fi
yes
[color=blue]-(user@host:tty)-(tmp)-
[4181 0] $ [/color]
      
师兄,非常感谢!!      
复制内容到剪贴板
代码:
[0 No.2008 huan@deb ~]$ case "abc123" in [a-zA-Z]*) echo Y;; *) echo N;; esac
Y

[0 No.2009 huan@deb ~]$ case "123abc" in [a-zA-Z]*) echo Y;; *) echo N;; esac
N

[0 No.2010 huan@deb ~]$