Tuesday, 15 September 2015

bash - How to extract numbers and special characters in a string in linux script -


I have a string like originir = / cp / osp / peaker / 1543.23. Here I want to remove 1543.23 in the Linux script, someone can tell me how to do it here.

sed, could be using regex, I was unable to do this. Here I want 1543.23 (That's why I want numbers and special characters).

you awk . Something like this

  echo on $ basis. | It starts by setting field separator (FS) in "/" and then printing the final field. <<  

/ P>


No comments:

Post a Comment