fork download
  1. #!/bin/bash
  2. s='nvcc: NVIDIA (R) Cuda compiler driver
  3. Copyright (c) 2005-2019 NVIDIA Corporation
  4. Built on Wed_Oct_23_21:14:42_PDT_2019
  5. Cuda compilation tools, release 10.2, V10.2.89'
  6. awk '/Cuda compilation/{sub(/,$/,"", $5); print $5}' <<< "$s"
Success #stdin #stdout 0s 4804KB
stdin
Standard input is empty
stdout
10.2