The following file worked yesterday, but today it isn't working any more.
Could be caused by either the apt-get upgrade or autoremove that I performed.
For some reason $PATH isn't working, I have no idea why not.
$ cat GW
#!/bin/bash
PATH="/media/Data/Wine/WineVersions/1.3.24/bin:$PATH"
export WINEPREFIX="/media/Data/Wine/WinePrefixes/GW"
export WINEDEBUG="-all"
cd "/media/Data/Wine/WinePrefixes/GW/drive_c/Program Files/Guild Wars"
wine Gw.exe
$ ./GW
./GW: line 6: /media/Data/Wine/WineVersions/1.3.24/bin/wine: No such
file or directory
$ ls /media/Data/Wine/WineVersions/1.3.24/bin/wine
/media/Data/Wine/WineVersions/1.3.24/bin/wine
I also tried export PATH="blablabla" but that didn't work either.
Edit: Requested info
$ file /media/Data/Wine/WinePrefixes/GW/drive_c/Program\ Files/Guild\ Wars/Gw.exe
/media/Data/Wine/WinePrefixes/GW/drive_c/Program Files/Guild Wars/Gw.exe: PE32 executable for MS Windows (GUI) Intel 80386 32-bit
# Not a symlink
$ ls -l /media/Data/Wine/WineVersions/1.3.24/bin/wine gives -rwxr-xr-x 1 j j 7244
2011-08-11 17:18 /media/Data/Wine/WineVersions/1.3.24/bin/wine
Apparently /media/Data/Wine/WineVersions/1.3.24/bin/wine exists, but is an orphaned symlink or otherwise broken.
I autoremoved a bunch of libraries that wine required, I hadn't installed the standard wine package, instead using individual builds.
ia32-libs allowed the executable to start, I am cross-referencing the contents of /var/log/apt/history.log with apt-cache showpkg wine1.2 to find what I need to install.
Related
I'm trying to install a package called fminuit http://www.fis.unipr.it/~giuseppe.allodi/Fminuit/Fminuit_building.html
on ubuntu 18.04 machine using Octave. The installation step "make -f Makefile.f2c_lnx.Octave" gives me the following error
WrapIO_Matlab.c:4:10: fatal error: mex.h: No such file or directory
Any idea how to remedy this,
cheers, Damir
The build instructions provided by FMINUIT ask you to manually adapt the Makefile to your setup. I'm guessing you did one of those steps incorrectly. I'm running Octave 6.0.0 (current development sources) and worked fine:
$ wget http://www.fis.unipr.it/~giuseppe.allodi/Fminuit/fminuit-src.tar.gz
$ tar xzf fminuit-src.tar.gz
$ cd fminuit-2011.05.31/fminuit/
# modify Makefile.f2c_lnx.Octave
$ make -f Makefile.f2c_lnx.Octave
$ make -f Makefile.f2c_lnx.Octave install
The tricky part is knowing what to modify on the Makefile. For my case, these were the lines (you need to know the exact Octave version and where you installed it):
#Octave prefix directory (typically /usr or /usr/local): modify if needed
-PREFIX=/usr
+PREFIX=/usr/local
#major version number
-OCTAVE_MAJOR=2
+OCTAVE_MAJOR=6
#minor-release version number
-OCTAVE_MINOR=9.12
+OCTAVE_MINOR=0.0
OBJS= mnintr_wrkrnd.o intrac.o WrapIO_Matlab.o doflush.o
MINUIT=Minuit_.o
INSTDIR=../bin/linux_$(ARCH)/octave$(OCTAVE_MAJOR)
The fminuit Makefile will "install" inside the fminuit source directory. You may also want to adjust its INSTDIR value. You need to adjust your Octave path to use it:
>> addpath('/wherever/you/build/fmunuit/fminuit-2011.05.31/bin/linux_x86_64/octave6')
>> fminuit # you probably can figure out how to call this function
error: fminuit: Too few input arguments
background
I really would like to search for a term in a directory full of Word docs. So I stumbled across this lovely solution. However this solution requires that catdoc is installed on mac.
what I have tried
now homebrew obviously doens't have catdoc:
$ brew install catdoc
Updating Homebrew...
Error: No available formula with the name "catdoc"
==> Searching for a previously deleted formula...
Error: No previously deleted formula found.
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
Error: No formulae found in taps.
macports does, but I use homebrew and It's not a good idea to have both on my machine.
So I did what any self respecting semi-programmer would do: try to install it from source:
$ ./configure
see outpout
$ ./make
see output
the last part of ./make gives me this
1 warning generated.
gcc -o catppt catppt.o pptparse.o charsets.o substmap.o fileutil.o confutil.o numutils.o ole.o -lm
echo "#! /usr/bin/wish" >wordview
echo set charset_lib "\"/usr/local/share/catdoc\"">>wordview
cat wordview.tcl >>wordview
chmod 0755 wordview
touch build
make[1]: Nothing to be done for `all'.
then when i run make install i get this
make: `install' is up to date.
and obviously catdoc doesn't work:
$ which catdoc
>> nothing
Question
How can I install this?
You could just use the built-in textutil to convert MS-Word documents to text:
textutil -stdout -cat txt SomeFile.doc
or
textutil -stdout -cat txt *.doc
To build catdoc / catppt / xls2csv on Mac OS X (macos)
tested with catdoc-0.95 on Mac OS X 10.9.5
Configuration
First, unless your documents are likely to be written in a Cyrillic language, start with:
$ ./configure --with-input=cp1252 --with-output=mac-roman
(if you are more likely to encounter files from Windows)
... or ...
$ ./configure --with-input=mac-roman --with-output=mac-roman
(if you are more likely to encounter files from MacOS)
Building
$ make all (or just $ make)
Installation
make --directory=src install; make --directory=doc install; make --directory=charsets install
This should compensate for the error you received, abbood. It appears the primary Makefile isn't running the install portion of the three subdirectories, for some reason. If a permissions error is reported, precede the above command with "sudo".
I don't believe this should be necessary, but I'm not familiar enough with makefiles to provide a more proper (textbook) fix.
One can, of course, get the same effect by:
$ cd src
$ make install
$ cd ../doc
$ make install
$ cd ../charsets
$ make install
$ cd ..
Cleanup
To remove all files created by make, type:
$ make clean
To remove all files created by make as well as those created by ./configure, type
$ make distclean
Under Mac OS 10.10.3, I installed gnu-sed by typing:
brew install gnu-sed --default-names
When I type it again, I get the message:
gnu-sed-4.2.2 already installed
However, even after rebooting the system and restarting Terminal, I still cannot use the GNU version of sed. For example:
echo a | sed ’s_A_X_i’
returns:
bad flag in substitution command 'i'
What should I do to get the GNU version working?
Here are the paths in my $PATH variable.
/Users/WN/-myUnix
/opt/local/bin
/opt/local/sbin
/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin
/Applications/calibre.app/Contents/MacOS
/opt/ImageMagick/bin
/usr/texbin
I'm sorry if my question seems obvious, but I am learning shell scripting on my own and don't quite understand yet how UNIX programs are installed. Any help to use GNU compliant commands (in this case sed, but soon I'll need others as well) on my Mac without causing damage or unnecessary clutter would be greatly appreciated.
Note (2019):
The --with-default-names option is removed since January 2019, so now that option is not available anymore.
When installing, Homebrew instructs on how to adapt the path, if one wants to use sed without the g prefix.
You already have the gnu-sed installed without the --with-default-names option.
With --with-default-names option it installs sed to /usr/local/bin/
Without that option it installs gsed
So in your case what you gotta do is:
$ brew uninstall gnu-sed
$ brew install gnu-sed --with-default-names
Update path if needed...
$ echo $PATH | grep -q '/usr/local/bin'; [ $? -ne 0 ] && export PATH=/usr/local/bin:$PATH
$ echo a | sed 's_A_X_i'
or use gsed as others suggested.
When you install the GNU version of sed for Mac OS X using:
$ brew install gnu-sed
The program that you use is gsed.
So for example:
$ echo "Calimero is a little chicken" > test
$ cat test
Calimero is a little chicken
$ gsed -i "s/little/big/g" test
$ cat test
Calimero is a big chicken
Also, to compliment the use of GNU command tools on Mac OS X, there is a nice blog post here to get the tools from linux:
Install and use GNU command line tools on Mac OS/OS X
$ brew install gnu-sed
$ export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"
With these two commands gnu-sed works properly
The sed that ships with OS X is in /usr/bin.
The sed that homebrew installs is in /usr/local/bin.
If you prefer to use the homebrew one, you have two options:
Option 1
Every time you want to use homebrew sed, type
/usr/local/bin/sed
or, preferably
Option 2
Move /usr/local/bin/ ahead (i.e. before) /usr/bin in your PATH in your login profile, like this
export PATH=/usr/local/bin:<other places>
If you need to use gnu-sed command with their normal names, you
can add a "gnubin" directory to your PATH from your bashrc. Just use the following command in your bash or terminal.
export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"
--with-default-names didn't work for me on Mac OS X 10.14.2 so I created a symlink named sed to gsed higher in the $PATH
I also created a symlink named sed.1 to the gsed.1 manpage higher in the $MANPATH so man would access the gsed manpage instead of the default sed manpage
this export PATH="/usr/local/opt/gnu-sed/libexec/gnubin:$PATH"
is only valid per terminal SESSIOn as soon as you restart its GONE ( Mojave )
Since the --with-default-names option was removed in Jan. 2019, my hack solution is:
# hack to override mac tools with homebrew versions (ls, sed, etc)
for p in `find "${HOMEBREW_PREFIX}" -type d -name gnubin` ; do
export PATH="${p}:${PATH}"
done
which is a little slow (crawling the dir every login) but works without forcing me to modify my .bashrc for every gnu tool I happen to install with brew.
A slightly faster way to do what #pjz suggests is the following:
for p in $(ls -d ${HOMEBREW_PREFIX:-/usr/local}/Cellar/*/*/libexec/gnubin); do
export PATH="${p}:${PATH}"
done
Of course this assumes every GNU package in brew will always have the same level of directories to get to gnubin.
Alternatively, you can speed up find by adding the -maxdepth 4 flag before -type d to reduce how far it has to do into directories.
When running brew install gnu-sed on latest homebrew it reports at the end:
==> Caveats
GNU "sed" has been installed as "gsed".
If you need to use it as "sed", you can add a "gnubin" directory
to your PATH from your bashrc like:
PATH="/opt/homebrew/opt/gnu-sed/libexec/gnubin:$PATH"
gnu-sed installs by default as gsed. However, if you look in /opt/homebrew/opt/gnu-sed/libexec/gnubi you'll find a sed command. So following the above instructions to update the path should mean sed runs gnu-sed.
This is a kinda silly question. I've installed Inkscape on my mac (Marvericks OS) following this page http://www.inkscape.org/en/download/mac-os/
I know there is a command line option with inkscape. I tried to type inkscape on Terminal and there is no such command. I'm confused... Does this mean that I need to install the linux version of inkscape in order to use the command line?
I have Inkscape installed in /Applications and running this from a terminal does the trick:
/Applications/Inkscape.app/Contents/MacOS/inkscape --help
Usage: inkscape-bin [OPTIONS...] [FILE...]
Available options:
-V, --version Print the Inkscape version number
... etc.
For ease of use symlink it to /usr/local/bin i.e.:
ln -s /Applications/Inkscape.app/Contents/MacOS/inkscape \
/usr/local/bin/inkscape
In general, on MacOS Inkscape needs to be called with an absolute path, and all files given as arguments should also be full paths. See also:
https://bugs.launchpad.net/inkscape/+bug/1449251
As of 2020, the executable on MacOS is now located at
/Applications/Inkscape.app/Contents/MacOS/inkscape
You can symlink it with:
ln -s /Applications/Inkscape.app/Contents/MacOS/inkscape \
/usr/local/bin/inkscape
More info about command line usage here.
I think some paths and filenames have changed over time and today you should add a symlink in /usr/local/bin to point to the bin directory of inkscape:
sudo ln -s /Applications/Inkscape.app/Contents/Resources/bin/inkscape /usr/local/bin/inkscape
Full credit to #Scott above who has this correct "answer" showing as a comment. This solution allows other subcommands of inkscape to work correctly, whereas creating an alias does not.
I know this might be more appropriate at Ask Different, but as I tried adding tags there, there was no vim tag, only macvim. So I figured I might get a better audience here.
In the Terminal, I do the following
$ vim --version
VIM - Vi IMproved 7.2 (2008 Aug 9, compiled Jan 31 2010 13:33:49)
When I browse to http://www.vim.org, I see a news item
Vim 7.3 released!
How do I update my built-in vim? I would very much like to do it cleanly (i.e. no duplicate installations, or any additional downloads, no macports, etc.)
I considered using Mercurial (as I already use it for other things), as per the instructions here.
$ hg clone https://vim.googlecode.com.hg/ vim
$ cd vim/src
$ make
But I think that would make a duplicate installation. Despite my "clean" requirement as mentioned above, "unclean" solutions are also welcome, since maybe there really is no other way.
If I understand things correctly, you want to install over your existing Vim, for better or worse :-) This is a bad idea and it is not the "clean" way to do it. Why? Well, OS X expects that nothing will ever change in /usr/bin unbeknownst to it, so any time you overwrite stuff in there you risk breaking some intricate interdependency. And, Let's say you do break something -- there's no way to "undo" that damage. You will be sad and alone. You may have to reinstall OS X.
Part 1: A better idea
The "clean" way is to install in a separate place, and make the new binary higher priority in the $PATH. Here is how I recommend doing that:
$ # Create the directories you need
$ sudo mkdir -p /opt/local/bin
$ # Download, compile, and install the latest Vim
$ cd ~
$ hg clone https://bitbucket.org/vim-mirror/vim or git clone https://github.com/vim/vim.git
$
$ cd vim
$ ./configure --prefix=/opt/local
$ make
$ sudo make install
$ # Add the binary to your path, ahead of /usr/bin
$ echo 'PATH=/opt/local/bin:$PATH' >> ~/.bash_profile
$ # Reload bash_profile so the changes take effect in this window
$ source ~/.bash_profile
Voila! Now when we use vim we will be using the new one. But, to get back to our old configuration in the event of huge f*ckups, we can just delete the /opt directory.
$ which vim
/opt/local/bin/vim
$ vim --version | head -n 2
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Aug 27 2011 20:55:46)
MacOS X (unix) version
See how clean this is.
I recommend not to install in /usr/local/bin when you want to override binaries in /usr/bin, because by default OS X puts /usr/bin higher priority in $PATH than /usr/local/bin, and screwing with that opens its own can of worms.... So, that's what you SHOULD do.
Part 2: The "correct" answer (but a bad idea)
Assuming you're set on doing that, you are definitely on track. To install on top of your current installation, you need to set the "prefix" directory. That's done like this:
hg clone https://bitbucket.org/vim-mirror/vim or git clone https://github.com/vim/vim.git
cd vim
./configure --prefix=/usr
make
sudo make install
You can pass "configure" a few other options too, if you want. Do "./configure --help" to see them. I hope you've got a backup before you do it, though, in case something goes wrong....
Don't overwrite the built-in Vim.
Instead, install it from source in a different location or via Homebrew or MacPorts in their default location then add this line to your .bashrc or .profile:
alias vim='/path/to/your/own/vim'
and/or change your $PATH so that it looks into its location before the default location.
The best thing to do, in my opinion, is to simply download the latest MacVim which comes with a very complete vim executable and use it in Terminal.app like so.
alias vim='/Applications/MacVim.app/Contents/MacOS/Vim' # or something like that, YMMV
Like Eric, I used homebrew, but I used the default recipe. So:
brew install mercurial
brew install vim
And after restarting the terminal homebrew's vim should be the default. If not, you should update your $PATH so that /opt/homebrew/bin is before /usr/bin. E.g. add the following to your .profile:
export PATH=/opt/homebrew/bin:$PATH
Note: Previous versions of Homebrew did install to /usr/local, so in that case you have to use /usr/local/bin instead of /opt/homebrew/bin.
A note to romainl's answer: aliases don't work together with sudo because only the first word is checked on aliases. To change this add another alias to your .profile / .bashrc:
alias sudo='sudo '
With this change sudo vim will behave as expected!
On Yosemite, install vim using brew and the override-system-vi option. This will automatically install vim with the features of the 'huge' vim install.
brew install vim --with-override-system-vi
The output of this command will show you where brew installed vim. In that folder, go down into /bin/vim to actually run vim. This is your command to run vim from any folder:
/usr/local/Cellar/vim/7.4.873/bin/vim
Then alias this command by adding the following line in your .bashrc:
alias vim="/usr/local/Cellar/vim/7.4.873/bin/vim"
EDIT: Brew flag --override-system-vi has been deprecated. Changed for --with-override-system-vi. Source: https://github.com/Shougo/neocomplete.vim/issues/401
brew install vim --override-system-vi
This blog post was helpful for me. I used the "Homebrew built Vim" solution, which in my case saved the new version in /usr/local/bin. At this point, the post suggested hiding the system vim, which didn't work for me, so I used an alias instead.
$ brew install vim
$ alias vim='/path/to/new/vim
$ which vim
vim: aliased to /path/to/new/vim
I just installed vim by:
brew install vim
now the new vim is accessed by vim and the old vim (built-in vim) by vi