I would like to be able to replace
cp x.x ~/some/long/directory/that/is/deeply/nested/
with
cp x.x s1
where s1 is an alias that points to /some/long/directory/that/is/deeply/nested/
However the destination frequently changes.
Today it is
/some/long/directory/that/is/deeply/nested/
next day it is
/some/long/directory/less/deep
next day it is
/some/other/directory/less/deep
Given that it is changing all the time is there an alias (or more likely function? as I think about it), is there a way I can do a cp with the destination being an 'interpreted' alias
something like
cp x.x `s`
The 'source' file was also be many different values. I don't want an alias that just points to one (or a list of a few) location or is for 1 (or a list of a few) source file. I want it to be whatever the alias points to at that time and the filename would be supplied when invoking it.
Source and destination could be any of thousands of values.
s1
being changed? Or are you asking whats1
should be and how it should be changed? If the latter, a symlink seems the obvious answer. – goldilocks May 03 '14 at 12:28s
in your home directory to the 'directory-of-the-day' and just usecp filename ~/s
? Then you can have a script creates/updates the link, you don't have to resource any alias, function or variable in all open terminals? – Anthon May 03 '14 at 12:35