How do you make a file executable in Unix?

How do you make a file executable in Unix?
Answer
Save the file as hello.sh (the . sh is just convention, it could be any file name). Then
run chmod +x hello.sh and you will be able to run this file as an executable. Move this file to /usr/local/bin and you should be able to run hello.sh from command line and it should execute your program.
 

Tìm kiếm

Back
Top