2

I am trying to run this command line on Windows (I've installed GNU coreutils 8.24)

echo android:versionCode="3267" | cut -d \" -f 2

Expected output: 3267

However, I am getting error:

cut: the delimiter must be a single character

Anyone know how can I use cut command to extract 3267 from android:versionCode="3267" ?

Atul
  • 163

1 Answers1

1

How can I use cut to extract 3267 from android:versionCode="3267"?

You need to escape the first pair of "s:

$ echo android\:versionCode=\"3267\" | cut -d \" -f 2
3267
$

(tested in Cywin bash)

DavidPostill
  • 162,382