I am trying to create a filename from 2 variables.
This is the error msg:
touch: cannot touch `/root/tinstalls/2--06/06/15': No such file or directory
2--06/06/15 19:54
This is the code:
tdate=$(date '+%D %R')
tfile=$(echo "${toadd}--${tdate}")
touch /root/tinstalls/${tfile}
echo $tfile
The directory is there.
/root/tinstalls/2--06/06/15 19:54
, you need to have directory/root/tinstalls/2--06/06
previously. Is it what you intended? And you need to quotes paths which include spaces. – yaegashi yesterday