- 论坛徽章:
- 32
|
回复 8# peawseshc
原封不动的复制粘贴:- [root@localhost ~]# cat t
- #! /bin/bash
- i="sdgfdg"
- if [[ "$i" =~ "^s.*g$" ]];then
- echo "yes"
- else
- echo "no"
- fi
- [root@localhost ~]# sh t
- no
- [root@localhost ~]# bash --version
- GNU bash, version 4.1.2(1)-release (i386-redhat-linux-gnu)
- Copyright (C) 2009 Free Software Foundation, Inc.
- License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
- This is free software; you are free to change and redistribute it.
- There is NO WARRANTY, to the extent permitted by law.
复制代码 |
|