Using powershell on win10 to invoke bash

 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Using powershell on win10 to invoke bash
# 1  
Old 03-06-2018
Using powershell on win10 to invoke bash

Hi Guys,

I am trying to run flyway command on ubuntu.

on windows command line is simple :

Code:
C:\Users\admin\Downloads\flyway-commandline-5.0.7-windows-x64\flyway-5.0.7> flyway migrate


how can i do it via bash?

i tied to use mnt command but starting flyway is not possible.

Please help,
Jacek
Moderator's Comments:
Mod Comment Please use CODE tags (not QUOTE tags) when displaying sample input, output, and code segments.

Last edited by Don Cragun; 03-06-2018 at 08:18 AM.. Reason: Change QUOTE tags to CODE tags.
# 2  
Old 03-06-2018
Is this the Flyway database migration tool? Are you attempting to run it in an Ubuntu subsystem on Windows, or from a separate Linux machine? If you are using a separate machine you should download and install Flyway for Linux.

Andrew
# 3  
Old 03-07-2018
Hi Andrew,

thank you!
YEs, flyway is a database migration tool.

Quote:
Are you attempting to run it in an Ubuntu subsystem on Windows
exactly this one

Best,
Jacek
# 4  
Old 03-07-2018
To start with, I know nothing about Windows 10 or the linux sub-system. But according to this how-to geek article you need the Creator's update or later to run Windows apps from bash, but you knew that already.

Have you tried cd'ing into the flyway directory and running it from there, as you did in your example using it from the command prompt? Remember that (1) bash is case-sensitive and (2) you will have to prefix the command with ./ as in
Code:
./flyway migrate

Andrew
# 5  
Old 03-12-2018
Hi Andrew,

cd is not working within bash, how can i do it?

Best,
Jacek
# 6  
Old 03-12-2018
Code:
cd /mnt/c/Users/admin/Downloads/flyway-commandline-5.0.7-windows-x64/flyway-5.0.7

does not work? What is the error?
Please don't just say "xxx does not work". Instead you should paste into your posting the command you type and the response (in code tags, of course).

Andrew
This User Gave Thanks to apmcd47 For This Post:
# 7  
Old 03-12-2018
Thank you Andrew!

cd /mnt/c/Users/admin/Downloads/flyway-commandline-5.0.7-windows-x64/flyway-5.0.7

Working !

But when i am within this folder and trying to run flyway.cmd
using code:

./flyway migrate

there is an error:
line 62: java command not found

i think that still here is a problem with running flyway command line from bash...

Best,
Jacek
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Execute powershell script with UNIX

Hi I have a powershell script which is checking whether a windows service is running (as shown below) function FuncCheckService { $ServiceName = 'pgsql-9.2' $arrService = Get-Service -Name $ServiceName if ($arrService.Status -eq 'Running') { Write-Output... (8 Replies)
Discussion started by: simpsa27
8 Replies

2. Windows & DOS: Issues & Discussions

Powershell + office 365

Hello ! I am looking for powershell guys. I have lot of office365 users ,and i need add/remove calendar items from powershell. my users have multiple calendars. how can i select calendar ,and how can i add / remove item to selected calendar. PS C:\appl\o365calendar> get-mailboxfolder... (0 Replies)
Discussion started by: zoldkovacs
0 Replies

3. Shell Programming and Scripting

Bash script - cygwin (powershell?) pull from GitHub API Parse JSON

All, Have a weird issue where i need to generate a report from GitHub monthly detailing user accounts and the last time they logged in. I'm using a windows box to do this (work issued) and would like to know if anyone has any experience scripting for GitAPI using windows / cygwin / powershell?... (9 Replies)
Discussion started by: ChocoTaco
9 Replies

4. Windows & DOS: Issues & Discussions

Help with PowerShell

I am very not knowledgeable with regards to Windows, and even more so with PowerShell, but I'm hoping someone can help me with what should be a fairly simple script. Remove all local accounts matching a given regular expression It seems like I'd need the following combined... Somehow... ... (0 Replies)
Discussion started by: Vryali
0 Replies

5. Shell Programming and Scripting

How to start powershell with shebang from windows/cygwin/bash?

I would like to the the windws8/cygwin/bash shebang feature to start a powershell script. I do a "chmod +x set-sound.ps1" and then at a bash prompt I do ./set-sound.ps1 The first line of ./set-sound.ps1 #!powershell.exe -ExecutionPolicy unrestricted The result is the result: ... (5 Replies)
Discussion started by: siegfried
5 Replies

6. Windows & DOS: Issues & Discussions

Powershell Script Help

Need some help getting this script to work. can someone help. I am trying to create a script that moves log files to another location and only keeps 60 days worth. please see script I started but having issue getting to work.. $TODAY=GET-DATE GET-CHILDITEM C:\test\*.LOG | Where {... (9 Replies)
Discussion started by: freedavis
9 Replies

7. Windows & DOS: Issues & Discussions

Does PowerSHell have *stat command analogs?

I.e. like vmstat, cpustat, iostat, fsstat, kstat ..etc? (1 Reply)
Discussion started by: Xcislav
1 Replies

8. Shell Programming and Scripting

Invoke a bash script with perl

Hi all, I use the perl script to invoke the bash script. and now there is a problem. my bash script lists as follows: and I use perl run this test scripts now the problem is when I run the perl script I find there is nothing recorded in the file /tmp/jdk.txt (2 Replies)
Discussion started by: Damon_Qu
2 Replies

9. Shell Programming and Scripting

Invoke Perl function from Bash ?

Is it possible to invoke a perl function from a bash script ? There are existing perl scripts with many functions that I want to reuse from a more recent script written in bash. Hence the question. (1 Reply)
Discussion started by: NewDeb
1 Replies
Login or Register to Ask a Question