Search code examples
linuxcut

Linux, How to using cut command with delimiters double quote?


i have a a line of text file contain this :

$gVER = "4.027.160921.1";

how to using cut in linux to delete double quotes and also the last (;), i just want to put the numbers value only. what i already try is this :

exec( "cat /web/FunctionInit.inc.php | grep gVER | cut -d \"=\" -f2"

when i using this code the result is :

"4.027.160921.1";

how to delimiters double quotes and the last (;) using cut linux?


Solution

  • This could work for you

     echo '"4.027.160921.1";' | cut -d'"' -f 2