Unable to start solr on windows - windows

I have installed solr on my machine in C drive and when I run the command bin\solr.cmd start it returns the below error:
binsolr.cmd: command not found
Any idea what is wrong?

You're apparently using a shell that uses \ for escaping letters.
Use bin/solr.cmd in that case, or use the old cmd console shell instead.

Related

How do i access AWS SAM-CLI through bash on windows?

I am running Windows 10 and can only access AWS SAM through command prompt but not bash. When i try to use bash, i get a bash: sam: command not found error.
If it helps, I currently have installed AWS CLI v2 and have installed it via an MSI file.
Why am i not able to use SAM through bash?
Edit: Yes i am aware that it doesnt explicitly say that you can use bash on the AWS setup guide
Verify the installation.
After completing the installation, verify it by opening a new command prompt or PowerShell prompt. You should be able to invoke sam from the command line.
However, I still want to be able to use it through bash. Is there a workaround?
Do you tried sam.cmd?
Sometimes bash don't know how to execute .cmd files. Here is a thread with this problem.
You can try this solution too:
alias sam='sam.cmd'

how to run .sh file in Ubuntu using installScript

I am creating an installation using InstallShield 2018 in windows 10. I need to execute a script file (.sh) in Ubuntu from a function in Installscript. I tried the following but it did not work:
szCmdPath = "C:\\Users\\Admin\\AppData\\Local\\Microsoft\\WindowsApps\\Ubuntu.exe";
szCmdLine = ". /mnt/d/test.sh";
LaunchAppAndWait( szCmdPath, szCmdLine, WAIT);
However I can execute the exact same file in Ubuntu Terminal and it works great. I did turn on Window sub system for Linux and install Ubuntu on windows. Why is this happening? Why can I run cmd.exe from installscript but not Ubuntu?
Thank you in advance.
EDIT 1: if I pass an empty string as parameter, Ubuntu is start and waits for my input commands. But when I pass the path to my script file, nothing happened except a flash of the terminal console before my installation goes on running.
From my reading, wsl and ubuntu differ slightly. It looks like wsl is a bit magical and occasionally similar to bash -c or ubuntu -c, whereas you can consider Ubuntu.exe as somewhat equivalent to /bin/bash.
If you try to run /bin/bash . /mnt/d/test.sh from a bash prompt, things don't go well. So the correct approach will depend on the contents of your script and what you need to happen. I think one of the following options are the most likely:
remove . from your command; instead run ...\Ubuntu.exe /mnt/d/test.sh
add -c to your command; instead run ...\Ubuntu.exe -c . /mnt/d/test.sh
Note that %LOCALAPPDATA%\Microsoft\WindowsApps\Ubuntu.exe is a special file (zero bytes), so it's also plausible that it needs some special handling. For instance, maybe it requires a 64-bit caller. If that's the case, you may need to wrap it in a call through a 64-bit cmd prompt. My quick tests don't show this as likely, however, so I think it will work without this extra indirection.

How can I make a Perl script executable in Windows 64bit?

I am trying to run the perl script through command line but it is not reorganizing the script file ie.
myscript.pl... is not working
but perl myscript.pl is working fine
I have tried the following suggestions but they didn't work either
How do I make my Perl scripts act like normal programs on Windows?
Perl execution from command line question
I am using Active Perl:- Perl 5 , Version 18.
It gives following warnings in both cases.
Using a hash as a reference is deprecated
earlier I installed strawberry perl before installing active perl, is that causing some problem.
The error message
Using a hash as a reference is deprecated
is a Perl message. Your script is being run just fine, but contains an error.
(It is remotely possible that you have two Perl versions installed, and that you configured Windows to use the wrong one. Reconfigure it to use the correct on then, using the guides you already found.)

How to change console code to 1252?

I am trying to use PostgreSQL on Windows 8 using the command line provided by Git Bash so I can run Unix like commands. When accessing Postgres with the following command: psql -U postgres I get:
Warning: Console code page (850) differs from Windows code page (1252)
etc...
in the Windows command tool, I just need to type chcp 1252 before accessing Postgres so the warning doesn't show up. What's the equivalent command in unix/git bash?
I tried to do chcp 1252 or chcp from Git bash but it outputs:
sh.exe": chcp: command not found
Any ideas?
Try "chcp.com 1252".
Git bash doesn't suppose ".com" as a implicit executable postfix.
It can't expand "chcp" to correct executable, so you should type fully "chcp.com".
You're using the Windows psql.exe binary under the msys bash.
This may not work well, as psql.exe is a Win32 binary. It uses stdio, but not the same way bash expects.
You'll want to either use a psql built against msys (not trivial), or use psql under cmd.exe or powershell.

how to run cygwin script in powershell

I am trying to run a cygwin script in powershell. How can I do that?
I tried giving full path of the scripts followed by args . it isnt working
example : /c/script/path/script args
Use either /cygdrive/c/script/path/script or C:/script/path/script (note the capital C and lack of leading slash in the latter path). Plus, need to run the script with the correct interpreter, e.g.:
& C:\cygwin\bin\bash.exe /cygdrive/c/script/path/script ...
Having cygwin installed with the ssh stuff and SCP utility you can simply issue:
C:\cygwin\bin\scp.exe /cygdrive/c/Users/YOU/Documents/file.txt root#remoteserver:/tmp/
I find above can marked solution becomes a bit too shortcoming as the bash profile is not quite the same as in a working cygwin bash environment.

Resources