'when the directory name have "*" inside created by linux, it show unreadable character on windows 10
#!/bin/sh
DOMAINLIST='*.io.domain.fun io.domain.fun *.*.domain.fun'
for i in $DOMAINLIST
do
mkdir $i
done
This shell code run out unreadable directory name
on my windows 10 . chinese character set
$ dir
_2X68P~X.A _E2MJ8~X.FUN
on my linux
# ls -alh .
total 32K
drwxr-xr-x 5 admin administrators 4.0K 2022-04-09 12:33 ./
drwxr-xr-x 6 admin administrators 4.0K 2022-04-09 11:06 ../
drwxr-xr-x 2 admin administrators 4.0K 2022-04-09 12:33 *.io.17lai.fun/
drwxr-xr-x 2 admin administrators 4.0K 2022-04-09 12:33 *.a/
maybe this is a character set problem?
Solution 1:[1]
I know now . Win10 can not have * in file or dir name!
Solution 2:[2]
it's probably not a good practice, but you can escape special characters with \ (e.g. mkdir '\*.a')
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | bloodkey |
| Solution 2 | vgratian |
