Skip to main content

Timeline for Unix file naming convention

Current License: CC BY-SA 2.5

10 events
when toggle format what by license comment
Jun 29, 2017 at 15:18 comment added bgvaughan I find using ".sh", ".py", ".pl", etc., is convenient, and some text editors (e.g., Geany) use those to make a first guess at the proper syntax highlighting scheme.
Apr 13, 2017 at 12:13 history edited CommunityBot
replaced http://serverfault.com/ with https://serverfault.com/
Jan 25, 2017 at 21:00 comment added Dan Moulding @Wildcard I have since (6 years ago) gotten into this same habit. The extension actually makes a lot of sense for sourcing script bits. For instance, from an executable script written for zsh (i.e. #!/bin/zsh at the top) you know you can safely source another file with the .zsh extension and be sure that it contains legal zsh code. If your executable script is strictly Bourne Shell compliant (i.e. #!/bin/sh at the top), then you'd know that sourcing that .zsh file is going to be problematic.
Jan 24, 2017 at 5:25 comment added Wildcard Tilde expansion is specified by POSIX.
Jan 24, 2017 at 5:19 comment added Wildcard @DanMoulding, personally, I use .sh on scripts which are (1) not intended to be run interactively, but only from other scripts/programs, or (2) are designed for sourcing rather than execution. For the former they must be executable; for the latter I leave the executable bit off and use the shebang line only for documentation of what shell the functions are written for.
Feb 25, 2011 at 11:56 history edited LawrenceC CC BY-SA 2.5
added 86 characters in body
Feb 14, 2011 at 20:15 history edited LawrenceC CC BY-SA 2.5
added more stuff
Feb 14, 2011 at 20:00 comment added LawrenceC A thing comes to mind that it's useful to emphasize the fact that it is a text-based script and not a binary.
Feb 14, 2011 at 19:07 comment added Dan Moulding I often see shell scripts with a .sh "extension" on them. I personally find it somewhat annoying, but I have to admit that I may be ignorant of some good reason for using the .sh.
Feb 14, 2011 at 15:44 history answered LawrenceC CC BY-SA 2.5