I added this line:
PATH=.:$PATH
to my .bash_profile
.
Now I have to make main.c
compile when I type zz
(under the same directory in ~/user/filename
)
zz
shell script?PATH
determines where executables are searched; it has no influence on where source files are searched. Source files without a directory component are searched in the current directory anyway. What you have to write to compile main.c
depends on the compiler used, which you didn't specify, but it's usually like cc main.c
. Also consider using make
rather than writing a shell script.