fork download
  1. #!/bin/bash
  2. s="git@ssh.gitlab.org:repo1/dir/dir/file1.git
  3. git@ssh.gitlab.org:repo1/dir/dir/file2.git
  4. git@ssh.gitlab.org:repo1/dir/dir/file3.git
  5. git@ssh.gitlab.org:repo1/dir/dir/file4.git"
  6.  
  7. awk -F':' '{sub(/\.[^.\/]*$/, "", $2); print $2;}' <<< "$s"
Success #stdin #stdout 0s 4156KB
stdin
Standard input is empty
stdout
repo1/dir/dir/file1
repo1/dir/dir/file2
repo1/dir/dir/file3
repo1/dir/dir/file4