coreutils
[Top][All Lists]
Advanced

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

install: /dev/stdin to be aliased as -


From: Marc Chantreux
Subject: install: /dev/stdin to be aliased as -
Date: Wed, 29 Jun 2022 11:29:19 +0200

Dear coreutils people,

I have an intensive use of install since I realized it can read
from /dev/stdin. I implemented a command "to" this way

        #! /bin/sh
        exec install -D /dev/stdin "$@"

Below, I wrote some of many examples of `to` I had since.

In many unix commands, - is an alias which means stdio
(in or out depends of the context). GNU coreutils uses this convention
in commands like cat or grep (eg: hostname | cat /etc/hostname -).

Implementing this convention in install would be an improvement:

* more consistent with other filters
* definitely shorter
* arguably more readable
* being explicit about this usage of install in the manual could help
* perhaps more portable than /dev/stdin (I don't know if it's POSIX standard)

An intern of mine is enthousiast about it and would like to propose a
patch but fisrt, I would like to discuss with you all about the
opportunity of improvement.

regards.

some useful exemples.

# in a deploy script:
user=admin passwd='PhunnyH0rr0rs(from)ProgrammerZ'
<<. to /etc/created-on-fly/credentials.yml
login: $user
passwd: $passwd

# to create a directory then write my file from vi
%w !to content/created-on-fly/index.md

# make to create all required directories of the
# static website
pub/%.html: content/%.md; pandoc $< | to $@

-- 
Marc Chantreux
Direction du numérique de l'Université de Strasbourg
Pôle de Calcul et Services Avancés à la Recherche (CESAR)
http://annuaire.unistra.fr/p/20200



reply via email to

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