I have a working folder with all output files generated from command. When I tried to re-coding one of my file, after a few attempts, I realized the files in my folder left only 1/3 of them! I first thought they are gone, and wanted to repeat the experiment XD
But when I tried to create a folder named "bin", it said:
mkdir: cannot create directory ‘bin’: File exists
and there is even files in the "bin" directory!
What is happening here? How can I check? 😅
Update: I was having window dual-boot with linux. I opened up my Windows (with not related intention) and just happened to realise that the missing folder could not be opened and was marked as corrupted (still not sure why until now). So I repaired the file as instructed by Windows, and I got them all back!) Thanks everyone for the help anyway! Appreciate them!
mkdir ${dirPath}/bin
and that thedirPath
variable (forr some reason) is not set , possibly a typo? Just a guess. ,,,, better debugging can be achieved withset -x
(set +x
to disable) ANDexport PS4='${LINENO} >'
(export PS4="+"
is the default value) . It will show each Line of executed code with all env-vars, cmd-substitutions, etc, expanded so you know exactly what command the shell tried to Run. All dbl-quoted strings are "normalized" to single-quoted strings.