0
Почему:Две команды в одной строке
free | cut -c67- && free | cut -c55-61
дает мне буфера и размер кэша, но
free -s4 | cut -c67- && free -s4 | cut -c55-61
дает мне только размер кэша.
Почему:Две команды в одной строке
free | cut -c67- && free | cut -c55-61
дает мне буфера и размер кэша, но
free -s4 | cut -c67- && free -s4 | cut -c55-61
дает мне только размер кэша.
От Баш человек страницы:
SHELL GRAMMA [...] Lists AND and OR lists are sequences of one of more pipelines separated by the && and || control operators, respec‐ tively. AND and OR lists are executed with left associativity. An AND list has the form command1 && command2 command2 is executed if, and only if, command1 returns an exit status of zero.
&&
оператор не будет выполняться до тех пор, command2 command1 не вышел с возвращаемым значением 0.
ли команда free -s4 | cut -c67-,56-61
более близко к тому, что вы хотите?