Often when moving files around, I need to do the opposite later. So in my .bashrc I included this working code:
rmv() {
mv $2/${1##*/} ${1%/*}
}
Now I wonder why I can't write this as a single liner. This is what I tried:
rmv() {mv $2/${1##*/} ${1%/*}}
If I do so, I get this error:
-bash: .bashrc: line 1: syntax error near unexpected token `{mv'
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…