bash 判断字符串

Submitted by lepton on Wed, 05/11/2016 - 16:24

Tags

判断字符串是否为整数

[[ "${str}" =~ ^-?[[:digit:]]*$ ]]  //正则表达式 不能加引号

expr match "$str" "^-\?[0-9]*$"

判断字符串 包含 123

[[ "${str}" == *"123"* ]]

Comments

cheap jordan shoes (not verified)

Tue, 03/28/2023 - 10:35

I am glad for writing to make you know of the exceptional experience my wife's child undergone reading your site. She even learned plenty of details, which included how it is like to possess a marvelous giving nature to have others smoothly understand specific impossible subject areas. You really exceeded my desires. Thanks for delivering these great, safe, explanatory as well as cool thoughts on your topic to Gloria.
cheap jordan shoes http://www.cheapjordanss.us.com

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.