I'm trying to make a script that creates a temporary folder with a particular name, specifically the base name of the folder I'm running the script from. To do this I've tried to do this with the following approach.
setenv suffix $(basename $PWD)
mkdir /tmp/userid_$suffix
But this fails with an illegal variable name error. I can't seem to figure this out after looking a number of sites and questions on here. How can I add the base name of the current folder to a new folder, either in one step or with setting a variable?
mktemp -d
? – Archemar Aug 02 '17 at 08:07