help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Avoiding a shebang to call awk


From: goncholden
Subject: Re: Avoiding a shebang to call awk
Date: Wed, 22 Feb 2023 18:37:11 +0000

------- Original Message -------
On Thursday, February 23rd, 2023 at 6:26 AM, Greg Wooledge <greg@wooledge.org> 
wrote:


> On Wed, Feb 22, 2023 at 05:18:05PM +0000, goncholden wrote:
> 
> > Do people customarily not care that the tool is an awk script ?
> 
> 
> On Debian 11, /usr/bin/which is an sh script. Yet it's not named
> "which.sh". You run it by typing "which", not by typing "which.sh".
> 
> On other Unix systems that I've used in the past, /usr/bin/which has
> sometimes been a csh script, and sometimes has been a compiled
> program. Yet I've never seen any Unix system that renames it to
> /usr/bin/which.csh or /usr/bin/which.elf.
> 
> The name of the file that implements a shell command is the name by
> which you invoke that command. The name should reflect what the
> program does, not what language it's written in.

That makes sense for scripting languages.  The difference with programming  
languages is that although filenames do use an extension (.c .cc .f), the
resulting program is run simply by its name.  Which makes sense.
 
> Separating the command's name from its initial implementation language
> also allows you the freedom to rewrite it in a different language later,
> without having to change every script that uses it.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]