I often need to create folders that start with the current date.
For example 190627_ABCD.
I've tried to create an alias command that gets the date to be printed:
a newf 'mkdir `date '+%y%m%d'_`+='
But this results in printing up the += at the end, which I was trying to use as an instruction to concatenate.
The idea being that I can add the ABCD in the command. So to get 190627_ABCD I type in the shell:
newf ABCD
But it isn't working for me. Grateful for any assistance!
As explained in Writing Aliases in csh and tcsh, you can use history expansion (since, in csh, history expansion occurs before alias expansion):
If you want your alias to accept multiple arguments (as well), use the history expansion
!*
andforeach
to loop over them:Example