I have a "sandbox" folder on my 13.10 PC, which I use for anything along the lines of "testing", or if I'm updating a piece of code and want it to be completely separate from everything else. In order to have some amount of order for this, I have this split into subfolders, in the following structure:
/data/Work/sandbox/mmyy/ddmmyy
(i.e. today's folder is /data/Work/sandbox/0214/260214
.)
In order to be able to switch to this directory quickly, I set up my .bashrc
so as to assign an environment variable, $TODAYSAND
, which changes daily and points to the correct folder, using the date
command:
TODAYSAND="/data/Work/sandbox/`date +%m%y/%d%m%y`"
This works fine in shells, so I've removed this line from .bashrc
and added it to my profile.d
in a new script, /etc/profile.d/sandbox.sh
. It still sources correctly, and in terminals I can still cd $TODAYSAND
without any issues at all.
I would now like to set a bookmark in Nautilus that points to this folder and changes dynamically in the same way, so that I don't have to track down the latest one every time. However, I can't get it to even accept $TODAYSAND
as a folder name. If I type it in the top bar (by typing a /
to let me input a path rather than searching), it tries to go to a non-existent file literally named /$TODAYSAND
and gives me an error saying that this doesn't exist. Similarly, if I make a bookmark pointing to $TODAYSAND
, it a) creates it with the same icon as if I had told it to bookmark a network location, and b) crashes out of Nautilus instantly when I click on it.
How can I go about making Nautilus accept this variable as a valid filepath?
cron
is one of those things that I can't remember ever having used, though. How would I go about doing this?.bashrc
toprofile.d
in the first place. Trying it in a shell was just a way of making sure it was still being sourced properly (and in fact, thekate
editor manages to expand it as well when started from the graphical interface, so it's certainly worked)