alias bp="cat $@ > [email protected]"
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
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With