Skip to main content
Neither field in the names list seems to have the gz extension so it should be added to both
Source Link
terdon
  • 252.2k
  • 69
  • 480
  • 718

Could that not just be:

<list_names.txt awk -F'\t' '{printf "%s.gz\0%s\0"gz\0%s.gz\0", $2, $1}' | xargs -r0n2 mv --

Or more efficiently:

perl -F'\t' -lae 'rename "$F[1].gz", $F[0]$"F[0].gz" or warn "$F[1].gz: $!\n"' list_names.txt

Could that not just be:

<list_names.txt awk -F'\t' '{printf "%s.gz\0%s\0", $2, $1}' | xargs -r0n2 mv --

Or more efficiently:

perl -F'\t' -lae 'rename "$F[1].gz", $F[0] or warn "$F[1].gz: $!\n"' list_names.txt

Could that not just be:

<list_names.txt awk -F'\t' '{printf "%s.gz\0%s.gz\0", $2, $1}' | xargs -r0n2 mv --

Or more efficiently:

perl -F'\t' -lae 'rename "$F[1].gz", $"F[0].gz" or warn "$F[1].gz: $!\n"' list_names.txt
Source Link
Stéphane Chazelas
  • 584.6k
  • 96
  • 1.1k
  • 1.7k

Could that not just be:

<list_names.txt awk -F'\t' '{printf "%s.gz\0%s\0", $2, $1}' | xargs -r0n2 mv --

Or more efficiently:

perl -F'\t' -lae 'rename "$F[1].gz", $F[0] or warn "$F[1].gz: $!\n"' list_names.txt