Where to install gpsbabel so it works with GPS::Babel perl module? - perl-module

I'm sad that I have to ask a question this simple but where should gpsbabel be installed in order to work with the GPS::Babel perl module? I can't seem to figure out the appropriate path and am hoping someone else who has it working can help. Thanks in advance for your help!

The GPS::Babel Perl module uses File::Which to find the gpsbabel executable.
The script/program you're running that "use"'s GPS::Babel needs to be run by a user that, when File::Which::which() is called, can find the gpsbabel executable in that user's OS-dependent PATH environment variable.
For example, installing gpsbabel on Linux results in gpsbabel being installed at /usr/local/bin. Since /usr/local/bin is in my path, when I invoke a Perl script use'ing GPS::Babel, File::Which::which finds gpsbabel in /usr/local/bin.
What OS? What's your PATH environment variable set to? Are you sure the gpsbabel executable was installed correctly, ie, can you verify the directory/folder it's installed in?
I had no issues downloading/installing gpsbabel and GPS::Babel just now and writing a quick hello world Perl script to use GPS::Babel, on Linux.

Related

MacOS Mojave: Command not found even though I can see the path when I echo $PATH

I've installed a tool on my Mac (10.14 Mojave) called ovftool (it also comes installed with VMware Fusion). It lives in my applications folder under VMware OVF Tool
I've edited my /etc/paths file and for good measure did the PATH=/Applications/VMware\ OVF\ Tool:$PATH along with adding it to my bash profile. Yet when I run the command ovftool I get the command not found message. Am I missing something here, is there some other way to set a PATH that I'm not aware of? This same exact path for this same tool has worked before on my machine.
EDIT: Here is the print out from my path_helper
PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware\ OVF\ Tool/ovftool.app:/Applications/VMware\ Fusion.app/Contents/Library/VMware\ OVF\ Tool/:/Applictions/VMware\ Fusion.app/Contents/Library/VMware\ OVF\ Tool:/Applications/VMware Fusion.app/Contents/Public:/usr/local/go/bin:/Applications/VMware\ OVF\ Tool"; export PATH;
You can CD into the folder and run it using ./ovftool for a workaround, at least.
The path adjustment should be something like
export PATH=/Applications/VMware\ OVF\ Tool.app/Contents/MacOS:$PATH
Also double check the name of the executable you are launching.
ls /Applications/VMware\ OVF\ Tool.app/Contents/MacOS
Use this :
export PATH=/Applications/VMware\ Fusion.app/Contents/Library/VMware\ OVF\ Tool/:$PATH

Mac OSx 7zcat command not found

I am trying to execute a Makefile script and my Mac complains about 7zcat, although I already have 7z installed.
/bin/sh: 7zcat: command not found
Any thoughts on what's missing on my system? Thank you!
I have never used 7zcat before.
However, it looks like it needs to be installed on your system.
https://github.com/essentialkaos/7zcat
Also, after you download install 7zcat you have to give it execute permission with chmod. Finally, you have to execute it by calling its full path for example if you installed it to the directory you are in you would run ./7zcat file.7z or you would add the path to the file to your environment's $PATH variable.
I hope this helps. You might have to do some more research though.
When you open a Terminal window and type 7zcat and hit enter, what happens? Same message? Well, if you cannot use it, why should make be able to use it? Where and how have you installed 7z? Is the folder with the 7z binaries in your PATH? Since if it isn't, of course the command won't be found.
When the system shall run a command, it will search for this command in the directories stored in the PATH variable. Execute echo $PATH in terminal and you will get a colon separated list of directories; only these directories are searched for binaries. So either you must move your binaries to one of these (or put a symlink to one of these) or add the directory with these binaries to the PATH.
Yet there is no official 7z command line installer for MacOS, which brings me back to the original questions "Where and how have you installed 7z?" And are you sure that whatever you installed even includes a 7zcat?

Compiling a bash script into a windows executable

I have a script which was origionally made for Linux, but adapted to run with Cygwin in windows, and if you already have the executables (sh, cp, mv, etc.) then you can run it without Cygwin. The only problem is that the script also uses a few hundred (yes hundreds) of other executables. Is there any way I can compile this script into a regular executable and pack these other supporting files in as resources?
The script is ~1600 lines long which is probably too long to confortably re-implement by hand in C++. I am looking to compile the script into something which windows can execute without having to make edits to the path to include a bunch of third party executables. A way to contain all this.
I doubt that the solution you have in mind is feasible.
Instead, I'd modify the script so that the first thing it does is figure out where all those hundreds of executables are. Then either set $PATH appropriately, or invoke each one by its full pathname.
Or you can have an installer that installs the executables in a specified or user-chosen location, then re-generates the script (from an input file) so it knows where the executables are. Ship with the-script.in, then have the installer perform textual substitutions to generate the-script from the-script.in.
I point out:
RPM and SHC
as a possible solution for your problem. Maybe this tools helps you to do the job.
Using SHC to Cygwin is possible to compile bash to exe
Ok. Realy old, but I was looking for it and decide to do my self and make it public.
http://goo.gl/M1NSY
Use ports of the required utils and use some application virtualization tool to package it all up. Cameyo is a free one. Forget Cygwin, that thing is huuuge :)

conflicting cygwin and windows path

if my windows path looks like this:
c:\ruby\bin;c:\cygwin\bin
then when i go into cgywin and enter "ruby" it will execute the ruby from c:\ruby\bin, failing to find the ruby installed in my cygwin. I have to exclude that path so cygwin would execute the one from /usr/bin.
But i need those 2 paths, since i want to run ruby in windows too.
Anyway to have cygwin have its own path and not inherit those in windows?
thanks.
Add an entry into your .profile to set the path to whatever you want it to be in cygwin.
In cygwin run the command:
$ <favourite text editor eg vi> ~/.profile
Then set the PATH environment variable to whatever you want it to be e.g.:
export PATH=/cygdrive/c/cygwin/bin
NOTE I can't remember whether you can use the c:... version of the path, but if you issue the env command you will see what it should be.

Why can't mysqldumpslow.pl find any Perl modules on Windows?

I'm trying to parse a MYSQL slow query log from the command line.
Upon entering this:
set PATH=G:\xampp\perl\bin\;%PATH%
cd /d G:\xampp\mysql\scripts
perl mysqldumpslow.pl -s c -t 10
The shell returns an error can't locate strict.pm in #INC (#INC contains: .) at mysqldumpslow.pl at line 8. BEGIN failed
In the perl directory in xampp, there is only one file perl.exe.
Am I missing perl modules/libraries? What do I need to read this log file?
A workaround is to find the location of strict.pm in your perl installation and to add the directory to the PERL5LIB environment variable, or to invoke perl with the
-I/path/to/strict.pm/directory option (see perlfaq8: How do I add a directory to my include path (#INC) at runtime?).
If you find more unsatisfied dependencies, keep adding directories to PERL5LIB or with additional -I options until your program can run.
(Though eventually you will probably get tired of this and fix/reinstall perl.)
UPDATE: Looking through the 1.7.3 XAMPP distribution, all of the perl library files are located under xampp\perl\lib and xampp\perl\site\lib, so
perl -IG:/xampp/perl/lib -IG:/xampp/perl/site/lib mysqldumpslow.pl -s c -t 10
is probably all that you need to do. YMMV if you have an older XAMPP distribution.
Your Perl installation seems to have been messed up in one way or another. I am not familiar with xampp, but I have a hard time believing they bundled just the perl.exe without the rest of the distribution.
Under G:\xampp\perl, there should be subdirectories such as lib, site etc.
strict is a core pragma and its absence indicates that you do not have a proper Perl installation.
In fact, I just downloaded xampp and it does contain lib and site\lib under xampp\perl (it is missing the documentation, but that is not essential to running Perl scripts).

Resources