Reputation: 716
I am trying to add custom variable in a bash script alias command and not able to do it
I added the following in .bash_profile
file
alias mvdb='mv ~/dbs/aw ~/dbs/aw-$1'
In the command line I am trying to run a script
mvdb "2017OCT20"
I want the folder named aw
to be renamed as aw-2017OCT20
when I run command
Upvotes: 2
Views: 2050
Reputation: 361595
This is a job for a function.
mvdb() {
mv ~/dbs/aw ~/dbs/aw-"$1"
}
Upvotes: 7