alias bp="cat $@ > $@.BACK"
My second idea was:
alias bp="cp $@{,.BACK}"
So i want to have a command to backup a file. It does not raise any error but it simply doesn't work.
alias bp="cat $@ > $@.BACK"
My second idea was:
alias bp="cp $@{,.BACK}"
So i want to have a command to backup a file. It does not raise any error but it simply doesn't work.
Aliases are purely a textual replacement. If you want to use or manipulate the arguments, you need to create a function:
bp () {
for file; do
cp -i "$file" "$file".BACK
done
}