mirror of
https://github.com/SinTan1729/random.git
synced 2024-12-26 13:18:35 -06:00
17 lines
No EOL
240 B
Bash
17 lines
No EOL
240 B
Bash
#!/bin/sh
|
|
|
|
# This simply makes a backup of a file as filename.bak
|
|
|
|
if [[ -n "$1" ]];
|
|
then
|
|
cp "$1"{,.bak}
|
|
fi
|
|
|
|
if [ $# -ge 1 ]; then
|
|
for f in $@
|
|
do
|
|
[ -n "$f" ] &&cp "$f"{,.bak}
|
|
done
|
|
else
|
|
echo "No filenames passed."
|
|
fi |