Closed 12425 closed 3 years ago
I'm not a Windows user so I have a few questions and comments.
I never call sqlite3.exe
anywhere in the script. Or does LSW translate sqlite3
to sqlite3.exe
? If so, wouldn't it make more sense to actually install the Linux sqlite under LSW?
The reason why I don't really want to use awk is that it might not be installed, even though it's pretty standard these days.
There are 3 options:
sed -i 's/\r//' filename
but -i
is not available on sed for macOS, so I would have to use a temp file and overwrite the original file.uname
show on Windows LSW? In that case we can use awk or run the above sed command.Do you mean WSL? I'm not running WSL, It's just git and sqlite3 for Windows.
Yes, in Windows most files have extension, and if you run sqlite3
it will actually locate sqlite3.exe
. The possible extensions are in this environment variable:
echo $PATHEXT
.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.wlua;.lexe
I agree to use sed
instead of awk
.
We don't have to use -i
and this change removes all trailing whitespaces.
for id in `sed 's/\s\+$//' $TMPFILE`
How do you run a bash file in Windows? As far as I know this can only be done when using the Linux Services for Windows. Either way, how can I check if it is actually running on Windows?
this change removes all trailing whitespaces.
Ok, thanks. This should work on Linux and Windows.
You can simply download PortableGit-*.7z.exe which is a self-extracting binary. Run the extracted git-bash.exe
and it simulates a bash environment. I ran jnrmor
inside it. At a low level it runs cat.exe
, sed.exe
etc. which are also extracted. That's why (I guess) the generated file is in dos format.
Ah, I see.
Ok, this change certainly doesn't hurt and if it fixes an issue on Windows, why not. Thanks!
Windows sqlite3.exe generates file in dos format and the extra
\r
causes wrong curl command and deletion failure. Instead ofcat
lines, useawk
to trim the\r
.