lua cmd can not recognize in macos though i installed - bash

I install lua success in my mac, but i got "-bash: lua: command not found" message when i run lua cmd, but i run /usr/loca/bin/lua success, i confirm the path that lua installed is included in PATH. I record some information as follow:
lxr:bin wang$ pwd
/usr/local/bin
lxr:bin wang$ echo $PATH
.;/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:JAVA_HOME/bin
lxr:bin wang$ lua
-bash: lua: command not found
lxr:bin wang$ pwd
/usr/local/bin
lxr:bin wang$ ls -l
total 872
-rwxr-xr-x 1 root wheel 80 11 23 00:40 VBoxAutostart
-rwxr-xr-x 1 root wheel 82 11 23 00:40 VBoxBalloonCtrl
-rwxr-xr-x 1 root wheel 80 11 23 00:40 VBoxBugReport
-rwxr-xr-x 1 root wheel 77 11 23 00:40 VBoxDTrace
-rwxr-xr-x 1 root wheel 79 11 23 00:40 VBoxHeadless
-rwxr-xr-x 1 root wheel 77 11 23 00:40 VBoxManage
-rwxr-xr-x 1 root wheel 79 11 23 00:40 VBoxVRDP
-rwxr-xr-x 1 root wheel 77 11 23 00:40 VirtualBox
lrwxr-xr-x 1 root wheel 14 3 28 2016 git -> ../git/bin/git
lrwxr-xr-x 1 root wheel 37 3 28 2016 git-credential-osxkeychain -> ../git/bin/git-credential-osxkeychain
lrwxr-xr-x 1 root wheel 24 3 28 2016 git-cvsserver -> ../git/bin/git-cvsserver
lrwxr-xr-x 1 root wheel 20 3 28 2016 git-shell -> ../git/bin/git-shell
lrwxr-xr-x 1 root wheel 26 3 28 2016 git-upload-pack -> ../git/bin/git-upload-pack
lrwxr-xr-x 1 root wheel 15 3 28 2016 gitk -> ../git/bin/gitk
-rwxr-xr-x 1 root wheel 221128 12 1 15:53 lua
-rwxr-xr-x 1 root wheel 150520 12 1 15:53 luac
-rwxr-xr-x 1 root wheel 2670 11 28 2014 pstorm
-rwxr-xr-x 1 root wheel 1394 3 8 2017 ssh-copy-id
-rwxr-xr-x 1 root wheel 75 11 23 00:40 vbox-img
-rwxr-xr-x 1 root wheel 77 11 23 00:40 vboxwebsrv
lxr:bin wang$ ./lua
Lua 5.3.0 Copyright (C) 1994-2015 Lua.org, PUC-Rio
>
lxr:bin wang$

The first two characters in $PATH should probably be .:, not .;.

Related

How to change python-config version on ubuntu

I have installed python3.6 in my desktop which already had python3.5 and python2.7 inside. I change the default path for both python and python3 to python3.6 but it seems like python-config is still on python2.7 and python3-config is still on python3.5. How can I change the default python3-config or python-config to python3.6-config?
Thanks for the help!
so to elaborate on my comment, python comes usually with a version attached like so
ls -lisa /usr/local/bin/ | grep python
34138948 16 -r-xr-xr-x 2 root wheel 5248 15 Apr. 03:12 python3.7
34138954 0 lrwxr-xr-x 1 root wheel 17 15 Apr. 03:12 python3.7-config -> python3.7m-config
34138948 16 -r-xr-xr-x 2 root wheel 5248 15 Apr. 03:12 python3.7m
34138949 8 -r-xr-xr-x 1 root wheel 2936 15 Apr. 03:12 python3.7m-config
34127071 16 -r-xr-xr-x 1 root wheel 5216 15 Apr. 10:59 python3.9
34127072 8 -r-xr-xr-x 1 root wheel 3153 15 Apr. 10:59 python3.9-config
as you can see some names are already symlinks (the once with the -> ) so if you wanna access python3.9-config as python3-config you need to make a symlink with the name python3-config that points to the binary python3.9-config.
% sudo ln -s /usr/local/bin/python3.9-config /usr/local/bin/python3-config
so which should now give you
% which python3-config
/usr/local/bin/python3-config
looking at the directory again shows the symlink now
% ls -lisa /usr/local/bin | grep python3
34127092 0 lrwxr-xr-x 1 root wheel 31 22 Juni 14:09 python3-config -> /usr/local/bin/python3.9-config
34138948 16 -r-xr-xr-x 2 root wheel 5248 15 Apr. 03:12 python3.7
34138954 0 lrwxr-xr-x 1 root wheel 17 15 Apr. 03:12 python3.7-config -> python3.7m-config
34138948 16 -r-xr-xr-x 2 root wheel 5248 15 Apr. 03:12 python3.7m
34138949 8 -r-xr-xr-x 1 root wheel 2936 15 Apr. 03:12 python3.7m-config
34127071 16 -r-xr-xr-x 1 root wheel 5216 15 Apr. 10:59 python3.9
34127072 8 -r-xr-xr-x 1 root wheel 3153 15 Apr. 10:59 python3.9-config
cheers
Markus

What does the * mean following a filename in Mac terminal [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
Does anyone know what the * following a filename in macOS terminal means?
All the file names in the folder:
/System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands
have a * trailing them and I'm not sure why.
For example:
jd#Mypc % ls -laF
total 1200
drwxr-xr-x 52 root wheel 1664 21 Sep 11:17 ./
drwxr-xr-x 8 root wheel 256 21 Sep 11:17 ../
-rwxr-xr-x 1 root wheel 38896 11 Aug 08:50 appletviewer*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 apt*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:49 extcheck*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 idlj*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jar*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jarsigner*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 java*
-rwxr-xr-x 1 root wheel 48512 11 Aug 08:50 java_home*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 javac*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 javadoc*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 javah*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 javap*
-rwxr-xr-x 1 root wheel 38896 11 Aug 08:50 javapackager*
-rwxr-xr-x 1 root wheel 37952 11 Aug 08:49 javaws*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jcmd*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jconsole*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jcontrol*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jdb*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jdeps*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jhat*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jhsdb*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jimage*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jinfo*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jjs*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jmap*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:49 jmc*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jps*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jrunscript*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jsadebugd*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:49 jshell*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jstack*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jstat*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jstatd*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 jvisualvm*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 keytool*
-rwxr-xr-x 1 root wheel 38896 11 Aug 08:50 native2ascii*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 orbd*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 pack200*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 policytool*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:49 rmic*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 rmid*
-rwxr-xr-x 1 root wheel 38896 11 Aug 08:50 rmiregistry*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 schemagen*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 serialver*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 servertool*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 tnameserv*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 unpack200*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 wsgen*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 wsimport*
-rwxr-xr-x 1 root wheel 38880 11 Aug 08:50 xjc*
jd#Mypc %
I'd love to know.
Thanks,
John
They have the trailing asterisk because (a) they're executable; and (b) you supplied the -F option to ls.
See the documentation for the -F option in the man page for ls:
-F Display a slash (`/') immediately after each pathname that is a
directory, an asterisk (`*') after each that is executable, an at
sign (`#') after each symbolic link, an equals sign (`=') after
each socket, a percent sign (`%') after each whiteout, and a ver-
tical bar (`|') after each that is a FIFO.
Those files have their executable bit set, e.g.
$ touch foo
$ ls -laF foo
-rw-r--r-- 1 user staff 0 Sep 27 18:33 foo
$ chmod a+x foo
$ ls -laF foo
-rwxr-xr-x 1 user staff 0 Sep 27 18:33 foo*
As for the executable-looking emulator that you can't actually execute, this can happen when the dynamic loader requested by emulator doesn't exist. You can check what kind of file emulator is with the command file emulator, and check what dynamic loader and libraries it needs with ldd emulator (any line showing “not found” is something you need to install). Given the name of the directory and the size of the file, emulator is probably a Linux x86 binary. I suspect you have an amd64 system. If so, you need to install a runtime environment for 32-bit applications; on Ubuntu, you need the ia32-libs package (and perhaps also ia32-libs-gtk). You could also get this error message for a script whose interpreter as indicated in the #! line doesn't exist.
https://superuser.com/questions/178786/what-does-the-asterisk-mean-after-a-filename-when-you-type-ls-l
same question here.

Not able to create bashrc in OS X

I am not able to create .bashrc file in the home directory. When I try to use touch I get:
touch: .bashrc: No such file or directory
When I type vim .bashrc in the home directory, and try to save using :w, it says
E166: Can't open linked file for writing
Edit:
Output of ls -l .bash*
lrwxr-xr-x 1 ankitsultana staff 34 Oct 30 2014 .bash -> /Users/ankitsultana/.dotfiles/bash
-rw------- 1 ankitsultana staff 7069 Nov 26 01:04 .bash_history
-rw-r--r-- 1 ankitsultana staff 2633 Nov 26 13:51 .bash_profile
-rw-r--r-- 1 ankitsultana staff 167 Sep 21 2014 .bash_profile-anaconda.bak
-rw-r--r-- 1 ankitsultana staff 1791 Jun 30 2015 .bash_profile.pysave
lrwxr-xr-x 1 ankitsultana staff 36 Oct 30 2014 .bashrc -> /Users/ankitsultana/.dotfiles/bashrc

Installing/linking g95 on osx

I found these libraries: http://www.g95.org/downloads.shtml. I downloaded the x86 OSX binaries, unzipped the file, and did ln -s bin/i686-apple-darwin10.3.0-g95 /usr/local/bin/g95, and added chmod +rx permissions to all these files, but I still can't run the g95 executable.
g95-install$ ls -la *
-rwxr-xr-x# 1 kilojoules staff 138126 Jan 17 2013 G95Manual.pdf
-rwxr-xr-x# 1 kilojoules staff 523 Jul 15 22:43 INSTALL
bin:
total 352
drwxr-xr-x# 3 kilojoules staff 102 Jan 17 2013 .
drwxr-xr-x# 6 kilojoules staff 204 Jul 15 22:43 ..
-rwxr-xr-x# 1 kilojoules staff 176968 Jan 17 2013 i686-apple-darwin10.3.0-g95
lib:
total 0
drwxr-xr-x# 3 kilojoules staff 102 Jul 15 22:39 .
drwxr-xr-x# 6 kilojoules staff 204 Jul 15 22:43 ..
drwxr-xr-x# 3 kilojoules staff 102 Jul 15 22:39 gcc-lib
$ ln -s bin/i686-apple-darwin10.3.0-g95 /usr/local/bin/g95
$PATH
-bash: /usr/local/bin:/usr/local/sbin:/Users/kilojoules/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin: No such file or directory
$ g95
-bash: g95: command not found
Why isn't there a brew formula for this?

what is ~/.npm dir for?

I have installed the global npm package jslint and it lives here
$ ls -la /usr/local/bin/jslint
lrwxr-xr-x 1 lust admin 40 Feb 12 15:31 /usr/local/bin/jslint -> ../lib/node_modules/jslint/bin/jslint.js
$ ls -la /usr/local/lib/node_modules/jslint/bin
total 8
drwxr-xr-x 3 lust staff 102 Apr 16 2012 .
drwxr-xr-x 10 lust staff 340 Feb 12 15:31 ..
-rwxr-xr-x 1 lust staff 2330 Apr 16 2012 jslint.js
$ which jslint
/usr/local/bin/jslint
$ head -3 /usr/local/bin/jslint
#!/usr/bin/env node
var linter = require("../lib/linter");
So it is without any doubt whatsoever at this point that jslint is in fact being run from this dir and not here:
$ ls -la .npm/jslint/0.1.9/package/bin/
total 8
drwxr-xr-x 3 lust staff 102 Apr 16 2012 .
drwxr-xr-x 9 lust staff 306 Feb 12 15:31 ..
-rwxr-xr-x 1 lust staff 2330 Apr 16 2012 jslint.js
There appear to be two copies of the package, one in /usr/local/ and one in ~/.npm. Why is there one in .npm and is it safe for me to remove it?
~/.npm is a cache that npm uses to avoid re-downloading the same package multiple times. There's no harm in removing it. You can empty it with the command:
npm cache clean

Resources