אורי wrote on Tue, 14 Dec 2021 07:44 +00:00:
> Actually I prefer the "<(..)" method, because sometimes I want to compare 2
> commands:
>
> diff <(pip freeze | sort) <(cat requirements.txt | sort)
>

Consider s/diff/comm -12/.

> Or even use cat and echo to add a specific line to one of the outputs. If I
> want the result to be completely null. For example to run in crontab and
> send me mail whether it's not null.

Careful here.  By default, cron jobs run not under your login shell but
under /bin/sh, and it's possible the latter doesn't support «<(…)» even
if the former does.

Cheers,

Daniel


> אורי
> u...@speedy.net
>
>
> On Tue, Dec 14, 2021 at 9:31 AM Eli Marmor <e...@netmask.it> wrote:
>
>> Use "-" instead the file name of one of both of the files, and pipe your
>> output to the diff command.
>>
>> ‪On Tue, 14 Dec 2021 at 09:12, ‫אורי‬‎ <u...@speedy.net> wrote:‬
>>
>>> Thank you.
>>>
>>> אורי
>>> u...@speedy.net
>>> _______________________________________________
>>> Linux-il mailing list
>>> Linux-il@cs.huji.ac.il
>>> http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
>>>
>>
>
> _______________________________________________
> Linux-il mailing list
> Linux-il@cs.huji.ac.il
> http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il

_______________________________________________
Linux-il mailing list
Linux-il@cs.huji.ac.il
http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il

Reply via email to