Issue
I want to do this
mv <some path> <some path>/../
Is there a way to pass argv[1]
as my argument and manipulate it, instead of writing the whole path again?
I.e.,
mv <some path> argv[1]/../
Solution
I've found the answer here. You can do it with:
mv file.txt !#:1.backup
!#
- refers to the current command.!#:1
- refers to the first argument of the current command
If you run this example you'll get:
mv file.txt file.txt.backup
Answered By - Pavlo Myroniuk Answer Checked By - Mary Flores (WPSolving Volunteer)