I’d like to create a file and hook it up somehow to a shell command that gets executed whenever I cat that file. So that the content of the file is the stdout of the shell command.
Something like /proc/meminfo.
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
/proc/meminfolives in a special filesystem,procfs, that is implemented by the kernel. You could use FUSE to do something similar in userspace.