fork download
  1. #!/bin/bash
  2. s="/iil/some/path/data/file1
  3. iil/some/path/log/file2
  4. /iil/some/path/BinDir1/file3
  5. iil/some/path/BinDir2/file4
  6. iil/log/file1"
  7. perl -pe 's,^/?iil/(?:.*?/)?(data|log|BinDir\d+),/$1,' <<< "$s"
Success #stdin #stdout 0s 19632KB
stdin
Standard input is empty
stdout
/data/file1
/log/file2
/BinDir1/file3
/BinDir2/file4
/log/file1