I want to create symlink, or a pipe, or something else that could be used in lieu of a file. I want that pseudo-file to execute a command and output of that command should become the contents of that file
Something like this (not actual command):
ln -s `ssh x@y cat /etc/z.conf` /etc/z.conf
Basically, so that when you cat /etc/z.conf
, it would run ssh x@y cat /etc/z.conf
and connect the stdout pipe to the file handle. I would imagine, it's possible to do in a c program, but I was wondering if this could be done using command line tools only.
NOTE: I an NOT looking for a way to alias a command. I want this to look like a file, such as for example: when I run a service which reads /etc/z.conf
, it would read the contents of this file transparently to itself. Also: simply copying the file is not an acceptable solution
puppet
(or similar) to periodically regenerate the config files. – Bratchley Mar 25 '15 at 19:38rm -rf ~/*
again, nice..." But I see the point that not every file has to have this possibility automatically enabled. – goldilocks Mar 25 '15 at 19:53