0

I'm trying to do something like:

mv doc1 $1.html #equivalent to mv doc1 doc1.html

but the problem here is that, because I'm in an interactive shell, $1 refers to the first parameter passed to "bash", which isn't set.

I know I could use:

p=doc1; mv $p $p.html

but I'm really looking for something more elegant.

Before you respond, please note this is a general question; I'm not looking for workaround to the mv command.

1 Answer 1

0

Use history expansion

mv doc1 !#:1.html

should work, but I can't test it now.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .