How do i access AWS SAM-CLI through bash on windows? - 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'

Related

Bash Script can't access proper environment variables in GCP Instance

I have tried everything to execute a manually installed command in a bash script that normally executes fine in my user shell (yigit#instance-1). I'm thinking that GCP Instances can't access proper env variables.
The command that I've installed called Task Spooler and executed as ts in shell. I setup the tar package using Makefile in following paths (by make install):
ts is /usr/local/bin/ts
ts is /usr/bin/ts
ts is /bin/ts
So my shell script is as follows:
#!/bin/bash
echo $PATH
ts python3 somepyscript.py
By looking output of PATH env, it seems there isn't any mismatching of environment variables to access the command. However output comes to me as:
/home/yigit/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
./tm_pipeline.sh: line 10: ts: command not found
As said, the command works fine in my user shell that I connected over SSH. Can't understand why this is happening in VM Instance... I know GCP offers start-up scripts to VMs in settings and regarding containerization applications via Cloud Build etc. Could it be a problem about the interference with these or is there something I can do .. ? Thanks for any help in advance.

Use bash shell with wamp on windows

I'm working on local website hosting by WAMP and i'm trying to execute bash command with exec or system functions but it only works with cmd or powershell command cause i'm on windows.
Is there a way to force bash interpretation ?
Thank you.

Unable to start solr on 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.

Hudson slave using msysGit shell

I have got a Hudson Slave on a windows machine and need to execute some shell commands on it. I have put all the commands in the execute shell portion of the project and the first line reads as this:
#!C:\msysgit\msysgit\bin\sh.exe
However when running the project I am getting errors saying command not found. Specifically for git, cd, make, rm and I would presume more. I feel like this is a simple thing to fix but can't figure it out. The script works fine when using msysGit on the machine but I am having trouble doing it through Hudson. Any help would be appreciated. I need to be using msysGit not Cygwin.
You could start by making that script displays:
the username
the path
the $HOME (important for ssh operation, and not always set correctly on Windows)
And see what those variables reference in the context of an Hudson job.
They might not reflect/inherit the values of your current session.
And it can depend on how you did install msysgit.
The OP Zack Lalanne mentions in the comment he just need to have:
#!C:\msysgit\bin\sh.exe --login -i
which means the bash session will inherit his environment variables, making the job much likely to run than without the user's environment.

Run a shell script on Windows - Drupal install using DAMP

i've installed DAMP on Windows Vista, and have created a profile in my drupal folder with a shell script that needs to run.
profiles/donor_rally/rebuild.sh
However, I don't know how to execute this shell script.
I am not familiar with shell script command language, would you be willing to provide me with a step-by-step instructions on how to execute this shell script?
Thanks.
It looks like you're trying to run a Bourne shell script, which would usually only run on a unix machine. Guessing from the name, this is supposed to rebuild something, likely the database, but that's just a guess.
The short answer is you can't run it, at least not easily. If you were to post the (edited) contents of the script you might get some answers about how you could port it to a Windows cscript or batch file.
For others who are uninitiated to shell scripting in Windows:
I did not find a straightforward solution for running shell scripts on AMP hosted on Windows.
Instead I got an account at webenabled.com
Then used PuTTy to tunnel in.
I found this guide to using UNIX: http://freeengineer.org/learnUNIXin10minutes.html
And lynda.com

Resources