Server is running FreeBSD 9.2.Using vim, I wrote the following script called hello:#!/bin/shecho hello worldThen I set it as executable:>chmod 755 helloThen I tried to run it from the command line (while in the same folder where the script was saved):>helloI got this error message:hello: Command not found.Is there something different I have to do to make an executable script in BSD?
can't get hello world shell script to run in FreeBSD
shell script;executable
You must type:./helloIf you type hello, the shell will try to find in $PATH any executable program named hello. In your case, you have not added your current folder to $PATH, so the shell can not find your program.Dot . in ./hello represent your current working directory, so the shell can expand it to /full/path/to/hello.