Browsed by
Tag: swap

[Bash] Script to swap contents of files

[Bash] Script to swap contents of files

There are two files (for example called „f1” and „f2”). We want to swap contents of these files. Here is an easy bash script, which solves this problem: #!/bin/sh # Created by Wojtek Jamrozy (www.wojtekrj.net) mv $1 cop_$1 mv $2 $1 mv cop_$1 $2#!/bin/sh # Created by Wojtek Jamrozy (www.wojtekrj.net) mv $1 cop_$1 mv $2 $1 mv cop_$1 $2 [download id=”8″]