How can I execute a command shortcut inside a command?
For example, I have: alias cdp='cd /home/username'
inside ~/.bashrc
and I want to execute: mv A cdp
,
where A
is a folder.
But it doesn't work?
Asked
Active
Viewed 94 times
0
-
2You cannot use an alias as a parameter to a command. In your example, it wouldn't be meaningful anyway... Try to use shell variables instead. – FedKad Jul 02 '21 at 11:11
-
3Does this answer your question? How to run an alias in a shell script? – vanadium Jul 02 '21 at 12:12
-
Yes, it does, thank you so much ! – Hamza Ben Cheikh Jul 02 '21 at 13:14