Why is It that I am not able to create a file? Here is my bash script:
#!/bin/bash
var=$(date +"%D")
sudo cp ./script1.sh "$var _script1.txt"
It's showing this error:
cp: cannot create regular file '01/23/20 _script1.txt': No such file or directory
I am even using sudo so there's definitely no permission problem.
/in the name so the date should be directories but it seems that the directories doesn't exists01with a subdirectory23with a file20_script1.txtyou'll have to usemkdir -psee stackoverflow.com/questions/947954/…