Giter Club home page Giter Club logo

Comments (10)

mortensorensen avatar mortensorensen commented on June 5, 2024

What's the output of echo $(find $QHOME -name q -type f)?

from poetiq.

danielkrizian avatar danielkrizian commented on June 5, 2024

Empty line:

MINGW64 /f/gdrive/q/poetiq (master)
$ echo $(find $QHOME -name q -type f)


MINGW64 /f/gdrive/q/poetiq (master)
$

from poetiq.

danielkrizian avatar danielkrizian commented on June 5, 2024

Seems like -type f is the culprit @mortensorensen :

MINGW64 /f/gdrive/q/poetiq (master)                                    
$ find $QHOME -name q -type f                                                                

MINGW64 /f/gdrive/q/poetiq (master)                                    
$ find $QHOME -name q                                                                        
F:\gdrive\q                                                                                  
F:\gdrive\q/code.kx.com/contrib/contrib/cskelton/studio/src/org/netbeans/editor/ext/q        
F:\gdrive\q/code.kx.com/contrib/contrib/sagrawal/lcs/q                                       
F:\gdrive\q/wikis/qwikis/kx.com/q                                                            
F:\gdrive\q/wikis/qwikis/www.kx.com/q                                                        

MINGW64 /f/gdrive/q/poetiq (master)                                    
$ find $QHOME -name f                                                                        

MINGW64 /f/gdrive/q/poetiq (master)                                    
$                                                                                            

from poetiq.

mortensorensen avatar mortensorensen commented on June 5, 2024

Wonder if it's because your q binary is called q.exe? Is your q.exe not in QHOME? Or do you call it QPATH? f means file so it should be fine

from poetiq.

danielkrizian avatar danielkrizian commented on June 5, 2024

Note my q.exe is under $QHOME/w32/q.exe and there is also $QHOME/q.bat

MINGW64 /f/gdrive/q/w32
$ $QPATH
bash: F:\gdrive\q\lib: Is a directory

MINGW64 /f/gdrive/q/w32
$ $QHOME
bash: F:\gdrive\q: Is a directory

MINGW64 /f/gdrive/q/w32
$ dir
bashrc.cmd  odbc.dll  q.exe

MINGW64 /f/gdrive/q/w32
$

from poetiq.

mortensorensen avatar mortensorensen commented on June 5, 2024

The obvious choice is just to take alias q but aliases only work with interactive shells and not when called with nohup (processes remain open after shell is closed - used in production environment).

I have tested this on my PC laptop and it seems to work although not bulletproof:

echo $(find $QHOME -path "*[w|m|l]??/q*" -type f)

Would like to come up with a more robust regex but Bash isn't playing nice.

from poetiq.

danielkrizian avatar danielkrizian commented on June 5, 2024

I broke it by coincidentally having qq.q file in the search path :)

MINGW64 /f/gdrive/q/poetiq (master)
$ echo $(find $QHOME -path "*[w|m|l]??/q*" -type f)
F:\gdrive\q/code.kx.com/contrib/contrib/azholos/qq/qq.q F:\gdrive\q/code.kx.com/contrib/contrib/azholos/qq/README.txt F:\gdrive\q/code.kx.com/contrib/contrib/azholos/qq/test/compile.q F:\gdrive\q/code.kx.com/contrib/contrib/azholos/qq/test/self.q F:\gdrive\q/code.kx.com/contrib/contrib/azholos/qq/te
...

MINGW64 /f/gdrive/q/poetiq (master)
$ source bin/control.sh

MINGW64 /f/gdrive/q/poetiq (master)
$ startp discovery discovery1--debug --args -new_console:nc:t:'discovery'
2016.10.16T07:55:55.903 |INFO| usr/bin/bash[11548] | - Starting process <discovery discovery1--debug> in the background
bash: F:gdriveq/code.kx.com/contrib/contrib/azholos/qq/qq.q: No such file or directory

MINGW64 /f/gdrive/q/poetiq (master)
$ echo $QBIN
F:\gdrive\q/code.kx.com/contrib/contrib/azholos/qq/qq.q

from poetiq.

mortensorensen avatar mortensorensen commented on June 5, 2024

Ok in lack of a prettier solution :)

case "$(uname -s)" in
    Darwin*|Linux*)             export QBIN=$(find $QHOME -path "*[m|l]??/q" -type f | head -n 1) ;;
    CYGWIN*|MINGW32*|MSYS*)     export QBIN=$(find $QHOME -path "*w??/q.exe" -type f | head -n 1) ;;
esac

Otherwise, could you let me know what it would take for find to find your q.exe file? Thanks

from poetiq.

danielkrizian avatar danielkrizian commented on June 5, 2024

Unambiguous match on Windows (only) is:

MINGW64 /f/gdrive/q/poetiq (master)
$ find $QHOME -type f -name q.exe
F:\gdrive\q/w32/q.exe

Q executable across platforms seems to be either q or q.exe.
Rather than messing with non-Win's alias or Win's PATH, my inspiration suggests the solution:

MINGW64 /f/gdrive/q/poetiq (master)
$ find $QHOME -type f \( -name q.exe -or -name q \)
F:\gdrive\q/w32/q.exe

from poetiq.

mortensorensen avatar mortensorensen commented on June 5, 2024

Cool, was not aware of that method. Thx

from poetiq.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.