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
# 8  
Old 03-12-2018
Quote:
Originally Posted by jaryszek
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
From your command prompt, type
Code:
echo %path%

and from your bash shell type
Code:
echo $PATH

and paste the results here.

Please use CODE tags, not ICODE tags.

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

Here is the code:

Code:
root@admin-Komputer:/mnt/c/Users/admin/Downloads/flyway-commandline-5.0.7-windows-x64/flyway-5.0.7# echo %path%
%path%
root@admin-Komputer:/mnt/c/Users/admin/Downloads/flyway-commandline-5.0.7-windows-x64/flyway-5.0.7# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/mnt/c/ProgramData/Oracle/Java/javapath_target_79965703:/mnt/c/Windows/System32:/mnt/c/Windows:/mnt/c/Windows/System32/wbem:/mnt/c/Windows/System32/WindowsPowerShell/v1.0:/mnt/c/Program Files/PuTTY:/mnt/c/Program Files/PostgreSQL/10/bin:/mnt/c/Program Files (x86)/Windows Live/Shared:/mnt/c/Users/admin/AppData/Local/Microsoft/WindowsApps:/snap/bin
root@admin-Komputer:/mnt/c/Users/admin/Downloads/flyway-commandline-5.0.7-windows-x64/flyway-5.0.7#

Best,
Jacek
# 10  
Old 03-12-2018
The first one should have been from your windows command prompt; it will give the executable path for windows programs.

Andrew
# 11  
Old 03-12-2018
What do you mean Andrew?

So my Path is not working correctly?

Jacek
# 12  
Old 03-12-2018
Quote:
Originally Posted by jaryszek
What do you mean Andrew?

So my Path is not working correctly?

Jacek
I meant for you to run the
Code:
echo %path%

from your Windows Command Prompt, also referred to as the "DOS Box", started from the Start Menu as CMD.EXE. Not the Power Shell, and not Bash.

I wanted to compare that path with the bash $PATH and see if I could spot where the java executable is, so I could advise you on how to adjust the bash $PATH.

Andrew
This User Gave Thanks to apmcd47 For This Post:
# 13  
Old 03-13-2018
Ok here is the code from windows cmd:

Code:
C:\Users\admin\Downloads\flyway-commandline-5.0.7-windows-x64\flyway-5.0.7>echo %path%
C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\PuTTY\;C:\Program Files\PostgreSQL\10\bin;C:\Program Files (x86)\Windows Live\Shared;C:\Users\admin\AppData\Local\Microsoft\WindowsApps;

Best,
Jacek

---------- Post updated 03-13-18 at 03:21 AM ---------- Previous update was 03-12-18 at 10:02 AM ----------

Anyone?

Jacek
# 14  
Old 03-13-2018
Not implying any deeper knowledge of the subject on my side, what catches my eyes is the discrepancy between the java paths:
/mnt/c/ProgramData/Oracle/Java/javapath_target_79965703 vs C:\ProgramData\Oracle\Java\javapath
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