Actually scripts breaking if files or paths have a space in them seems to be a thorn in the side of dev/ops/it folks that never goes away, does it?
Actually scripts breaking if files or paths have a space in them seems to be a thorn in the side of dev/ops/it folks that never goes away, does it?
Related, any time I join a new group, that uses bash in any capacity, I introduce them all to the `shellcheck` utility [2], and run a shell script of the person with the largest ego through, as a "demo".
[1] https://stackoverflow.com/a/9838604/1487072
[2] Online version: https://www.shellcheck.net/
Only because they were started to hit MAX_PATH there:
C:\Users\Johnathan Aparecido da Silva\AppData\Local\ASUS\ASUS System Control Interface\AsusSoftwareManager
C:\Documents and Settings\Johnathan Aparecido da Silva\AppData\Local\ASUS\ASUS System Control Interface\AsusSoftwareManagerI used it to hide my old virus/malware collection, made from what my computer was infected with through the years.
For example:
D:\test>dir
...
08/10/2023 09:29 AM <DIR> .
08/10/2023 09:30 AM <DIR> Foo Bar
08/10/2023 09:35 AM 79 Foo.bat
...
D:\test>dir "Foo Bar"
...
08/10/2023 09:30 AM <DIR> .
08/10/2023 09:29 AM <DIR> ..
08/10/2023 09:35 AM 79 Foo.bat
...
D:\test>type Foo.bat
@echo off
echo Executable: %0
echo Path to executable: %~dp0
echo Params: %*
D:\test>type "Foo Bar\Foo.bat"
@echo off
echo Executable: %0
echo Path to executable: %~dp0
echo Params: %*
D:\test>Foo.bat hello
Executable: Foo.bat
Path to executable: D:\test\
Params: hello
D:\test>Foo Bar\Foo.bat hello
Executable: Foo
Path to executable: D:\test\
Params: Bar\Foo.bat hello
D:\test>"Foo Bar\Foo.bat" hello
Executable: "Foo Bar\Foo.bat"
Path to executable: D:\test\Foo Bar\
Params: hello
D:\test>
Mess up the quotes and you're executing something one level up.(btw most IT folks prefer powershell, if only because all the management tools are powershell modules)