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: Greg Wooledge
Subject: Re: Avoiding a shebang to call awk
Date: Wed, 22 Feb 2023 13:26:26 -0500

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.

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]