I am creating a directory using the following command in Unix. This line is a part of a shell script which I am trying to run.
mkdir ./R
And it makes a dir named R?
What does this mean?
I am creating a directory using the following command in Unix. This line is a part of a shell script which I am trying to run.
mkdir ./R
And it makes a dir named R?
What does this mean?
Assuming you're using ls to see this ? symbol, man ls notes that the --hide-control-chars will insert ? symbols where a filename has non-graphic characters. Assuming this flag is set (e.g. if you have an alias alias ls=ls -q) It's possible your mkdir command has an additional non-printing character after the R (e.g. if you copy-pasted the line from somewhere).
Your shell script has DOS line endings. The shell sees the command as mkdir ./R^M where ^M is a carriage return. You can confirm this with cat -v.
$ cat -v script
mkdir ./R^M
ls will print control characters with question marks ?. Printing them directly would mess up its output.
To fix the file convert it from DOS to UNIX format.