国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

linux - bash 如何取文本中的數(shù)字
伊謝爾倫
伊謝爾倫 2017-04-17 11:25:31
0
2
219

文件里有一行 public string strVersion = "34"; 用bash shell怎么只取 34 并且 +1 后再保存文件 文件保存后 應(yīng)該是 public string strVersion = "35";

伊謝爾倫
伊謝爾倫

小伙看你根骨奇佳,潛力無限,來學(xué)PHP伐。

reply all(2)
大家講道理

Looking at the syntax, it feels like JAVA system

It may be possible to use search and regex.

But I think you can consider writing a class BashHelperConsole. This class refers to the class to which your strVersion belongs, and then Console provides a public method to output strVersion to stdout; your bash can use the java command line to directly call this BashHelperConsole class. , use the return as the variable content, in the form:

strVersion=$( calling_command )

I always do this in my projects, because I output what I want, so it is correct. It just requires the two languages ??to cooperate with each other.

Ty80

I hope the "one line" you mentioned really looks like that, with nothing more and nothing less.

awk '/public string strVersion = "[0-9]+";/ { d = substr(, 2, length()-3); sub(d, d+1); }; 1'
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template