Is it possible to execute a command on another command in UNIX shells?
If this is not possible, can I use the output of the previous command as the input of the next command, as in:
command xThen command y,
command x
command y
where in command yI want to use the output command x?
? , . , , , . ( ), "find", Colin , "-exec" "find". , stdin, "xargs". , "$ (command)" ( "command" [ "backquote]) . , , , , .
.
, cat.txt
cat & grave; echo file.txt & grave;
, ;
You can do something like:
x=$(grep $(dirname "$path") file)
here it dirname "$path"will be launched first, and its result will be replaced, and then grep will be launched, looking for the result dirnameinfile
dirname "$path"
dirname
file
Source: https://habr.com/ru/post/1765512/More articles:Requires: C # math programming library - mathAutoconf for Visual C ++ - visual-c ++How to transfer model changes in pylons / sqlalchemy? - pythonWhat errors does this Perl code have? - arraysHow to delete child records, and not set foreign key in null - javaPHP sendmail не отправляет - phpforce the ceiling to read (*) in a sql query - sqlC ++: template parameters for a class, but not a function - c ++In java, what is the best way to sort an integer array if only the last element of the number is offset? - javaHow to use facebook user dialog like this example - facebookAll Articles