Как мне создать программу на Linux C, которая поддерживает подключение к ней через оболочку? ⇐ Linux
-
Anonymous
Как мне создать программу на Linux C, которая поддерживает подключение к ней через оболочку?
There are certain programs in Linux that can take input from other programs with a syntax like this:
echo neofetch | pacman -S -
which will pipe "neofetch" into pacman in place of the single dash, resulting in it installing neofetch. How can I make my own C program for Linux that supports this syntax?
I already know that to take piped input into a program you would use stdin, but i don't know how to do that. I have not found any other info on this topic, only stuff about pipe(), which doesn't seem to be the way to do this.
Источник: https://stackoverflow.com/questions/780 ... -the-shell
There are certain programs in Linux that can take input from other programs with a syntax like this:
echo neofetch | pacman -S -
which will pipe "neofetch" into pacman in place of the single dash, resulting in it installing neofetch. How can I make my own C program for Linux that supports this syntax?
I already know that to take piped input into a program you would use stdin, but i don't know how to do that. I have not found any other info on this topic, only stuff about pipe(), which doesn't seem to be the way to do this.
Источник: https://stackoverflow.com/questions/780 ... -the-shell
Мобильная версия