fork download
  1. #!/bin/bash
  2. s='name: linuxVol
  3. id: 6
  4. type: Linux
  5. dir excludes: .snapshot*
  6. ~snapshot*
  7. .zfs
  8. .isilon
  9. .ifsvar
  10. .lustre
  11. inode: 915720
  12. free_space: 35.6TiB (auto)
  13. total_capacity: 95.0TiB (auto)
  14. number_of_files: 5,789,643
  15. number_of_dirs: 520,710
  16. mounts: h''ttps://server1.example.com:30002: /mnt/tube'
  17.  
  18. awk '/type:|mounts:/{gsub(/https?:\/\/|:.*/, "", $2); a = (length(a)==0 ? "" : a " ") $2} END{print a}' <<< "$s"
Success #stdin #stdout 0.01s 5408KB
stdin
Standard input is empty
stdout
Linux server1.example.com