How do I run in Bash under Atlassian Bamboo? - bash

I'm hosting my Bamboo on a Windows server and would like to run a script in Bash shell. I have learned that I could do that with in-line shebang. So I selected "Shell" as my interpreter and wrote the script:
#!/bin/bash
perl -pa ebin -s myapp start -detached
The failure report was as below:
'#!' is not recognized as an internal or external command, operable program or batch file.
What was missing here?
Also, I tried to put the above script content in a batch file (.sh) to execute it with Bamboo Command. I put the file in the root directory and set the path of it on Bamboo as just the file name. Then the build just got broken there and there was no log displaying about it.
Any solution that would solve my problem is much appreciated!
(Bamboo version 6.1)

Related

Is there any way to execute and sh file that executes a file in linux, through a shared folder in windows?

I have a python program on linux that processes some files and I created a .sh file to execute the script. It is available on a shared folder, which is also accessed through windows.
If I try to execute the .sh file through the shared folder on windows, it transforms the path of the python script to a windows path (e.g. on linux it's home/folders/main.py, and windows executes it as K:\home\folders\main.py) and I don't want that.
I want to run the .sh file through windows but as if I was executing it on linux...
My .sh file is as simples as this:
echo "execute file"
python3 /home/folder/ScriptForManualInput/Main.py > log.log
echo "File executed. Please, check the log.log file"
Maybe script remote ssh commands through batch files? I honestly don't know how. Can anyone help me?

UNIX command on Windows using Git Bash -- Error: "'C:\Program' is not recognized"

I just installed Git bash in order to run a UNIX command. I am trying to recreate a project starter which is using UNIX; it seemed there was no way for Windows to run a "grep" command without using something like Git bash.
I CD into the project folder directory
mboyl#DESKTOP-8R019P7 MINGW64 ~/lei_broker (master)
Then I run my command
$ heroku config:set SANITY_READ_TOKEN=$(grep SANITY_READ_TOKEN .env.development)
And am met with the error
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
What is going on here? 'C:\Program' is not included in my command.
My initial troubleshooting has recommended using a shell besides Git bash or setting an environment variable. My technical chops are limited, so if there is a simple Linux/UNIX syntax error I am making, please advise.
Matt
Posting as an answer since I need 50 Reps.
While I don't know what's inside the file .env.development, why not wrap all Windows paths with single-quotes & try?

I installed cygwin on Windows 8 recently. When I try to run an executable file using './' , it gives me the following error. How do I fix this?

I installed cygwin on Windows 8 recently. When I try to run an executable file using './' , it gives me the following error. How do I fix this?
'.' is not recognized as an internal or external command, operable program or batch file.
In the cygwin if we need to see output
sh filename.sh
Example: sh hello.sh
working good getting output in cigwin
In the unix terminal if we need to see output
./filename.sh
Example: ./hello.sh
working good getting output in cigwin aswell as linux

using mongodump to extract meteor data

I'll preface this by saying I have very little coding knowledge other than a few mongo tutorials so this may be a very simple answer, I'm trying to extract the data from my meteor project into a text file that can be edited.
Previously I've just had meteor (and Node.js) installed but I've installed MongoDB because without it my cmd window would tell me "'mongodump' is not recognized as an internal or external command, operable program or batch file"
I then followed the instructions here and confirmed that my host is at 127.0.0.1 with a port of 3001. At this point I also began running my meteor project and opened a new shell.
The project is running at D:/projectName and when I execute "mongodump -h 127.0.0.1 --port 3001 -d meteor" from there it still says "'mongodump' is not recognized as an internal or external command, operable program or batch file"
But if I execute the same line from the mongodump.exe directory (C:\Program Files\MongoDB\Server\3.2\bin) then it says "Failed: error dumping metadata: error creating directory for metadata file dump\meteor: mkdir dump: Access is denied"
The user you log in with doesn't have permissions to write to the
C:\Program Files\MongoDB\Server\3.2\bin
directory. mongodump wants to write to a directory beneath the current working one.
You can do two things. You can add the above path to your system executable path and then run mongodump from a directory you have write permissions on.
Or you can keep running it from the above directory but specify the --out option with a path to a directory you have write permissions on.
1- run cmd as an administrator
2- write in cmd : cd "C:\Program Files\MongoDB\Server\4.2\bin"
3- write in cmd mongodump
then it will work successfully

How to run executable file in Apple Script

I'm trying to run a executable file using applescript in FileMaker.
I've been trying...
do shell script "./firstscript"
This results in the error "sh: ./firstscript: No such file or directory"
If I type './firstscript' directly in bash the file is properly being executed.
Any ideas on how I should be pointing to my executable file inside the apple script?
You probably have the wrong working directory - use a full path instead, e.g.
do shell script "/path/to/firstscript"

Resources