Skip to content

Instantly share code, notes, and snippets.

@briandfoy
Created July 6, 2012 06:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save briandfoy/3058464 to your computer and use it in GitHub Desktop.
Save briandfoy/3058464 to your computer and use it in GitHub Desktop.
Switch file names
#!perl
die "Two files only!\n" if @ARGV != 2;
rename $ARGV[0] => my $temp = "$ARGV[0].bak";
rename $ARGV[1] => $ARGV[0];
rename $temp => $ARGV[1];
unlink $temp;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment