Skip to content

Instantly share code, notes, and snippets.

@CatTail
Created August 7, 2015 06:50
Show Gist options
  • Save CatTail/5481b2129ca445ba6de0 to your computer and use it in GitHub Desktop.
Save CatTail/5481b2129ca445ba6de0 to your computer and use it in GitHub Desktop.
Switch two file
#! /bin/bash
TMPFILE="$1-${RANDOM}.bak"
mv $1 $TMPFILE
mv $2 $1
mv $TMPFILE $2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment