0

I'm making an alias to just rename a file. I have the following alias:

alias change 'mv argv[1] argv[2]'

I have a file in my directory called calendar. When I enter

change calendar new_cal

I want the filename to change to new_cal. Instead, it returns

mv: No match.
DanR
  • 7
  • 2

1 Answers1

2

This will work:

alias change 'mv \!:1 \!:2'

$argv gets you the arguments passed to the script, while \!:1 and \!:2 will get you the first and second arguments passed to this command.

Also see Unix tcsh - alias using command line argument $1 versus \!:1