BASH variables

jgaber@uoguelph.ca's picture

I'm trying to create a 'rename' alias for BASH, but I don't know how to use variable data as parameters. Here's what I have so far:

alias rename $var1$ $var2$ = 'cp $var1$ $var2$ & rm $var1$'

What do I put in places of those vars?

rvarga@uoguelph.ca's picture

Isn't mv basically a rename?

Isn't mv basically a rename?

dlachape@uoguelph.ca's picture

Agreed, why would you need

Agreed, why would you need to make an alias for rename, "mv" will rename files for you:

mv file1.txt file2.c

Dave
----
"The only thing more dangerous than a hardware guy with a code patch is a programmer with a soldering iron."

jgaber@uoguelph.ca's picture

Right...

Forgot about that. Alright, thanks guys.
___________
Josh Gaber

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.