Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you suffix the end of a bash file?

Tags:

bash

I know this is probably me being dumb, but here's what I'm confused on:

  1. What are the suffixes called at the end of a file? ie. .txt, .php, .html, etc

  2. What suffix does a bash file use? .bash?

Thanks for helping my stupidity to be no more.

like image 751
Alex Cory Avatar asked Apr 18 '14 18:04

Alex Cory


1 Answers

These are called file extensions. By convention, shell scripts including Bash scripts get a .sh extension (for "SHell script").

Note that this is not a requirement for the script to execute. You can leave it off, or give it a different file extension (such as .bashrc for example, for the default Bash initialization script) and it will still run all the same.

like image 73
nneonneo Avatar answered Sep 23 '22 17:09

nneonneo