-bash command not found

-bash command not found
0

#1

I tried entering commands in iTerm 3, which previously worked just fine. Now when I tried
$ puts “blah blah blah"
it returns:
” -bash command not found"
Other commands behave the same…
what is wrong here?


#2

Hi,

You can set your path this way:

export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
and you can always add other directories if you want. Hope this helps.


#3

thanks for answering me… I have been trying to understand this for a couple of years… and it just doesnt sink in…
I was doing work on terminal… and using $puts "sllsdlfjlsfllflj"
it says command not found…here is what $PATH returns…

-bash: /usr/local/git/bin:
/opt/sm/bin:
/opt/sm/pkg/active/bin:
/opt/sm/pkg/active/sbin:
/Users/Tish/.rvm/gems/ruby-2.2.6/bin:
/Users/Tish/.rvm/gems/[email protected]/bin:
/Users/Tish/.rvm/rubies/ruby-2.2.6/bin:/
usr/bin:
/bin:
/usr/sbin:
/sbin:
/usr/local/bin:
/usr/local/git/bin:
/usr/local/rvm/gems/ruby-2.3.1/bin:
/Users/Tish/.rvm/bin:
/Applications/Postgres.app/Contents/Versions/latest/bin:
/Users/Tish/.rvm/bin:
/Applications/Postgres.app/Contents/Versions/latest/bin:
/usr/local/mysql/bin: 
No such file or directory

#4

Isn’t puts a ruby keyword? You have to run ruby first for that.


#5

eh… it may be, but I wasn’t doing any ruby… I was just following a tut, and it was creating a directory, then asking you to make a file… I’ve been messing around in the terminal, I thought maybe I screwed something up…


#6

You did, puts is not a command that is available by default (not a sh-ell builtin), neither it is common — I haven’t heard of it. So no wonder the system can’t find the application. So check that tutorial for what type of terminal/shell it is.

I think you are trying to emulate “echo”.


#7

puts is a ruby method so it won’t work in shell, unless you run ruby interpreter. You can use echo to print something back in shell, or redirect its output to a file(echo "some random junk" > file.txt).