> On Tue, Oct 17, 2000 at 04:59:48PM +0200, guy keren wrote:
> > there is a dirty method you could use. every once in a while (perhaps even
> > via a cron job), execute the command:
> > 
> > :>/path/to/.xsession-error
> 
> Cool.
> 
> I love these little shell tricks... I'm personally particularly fond
> of the old "(cd dir1; tar c) | (cd dir2; tar xv)" thing, but it's been
> discussed here extensively before.
> 
> Also, seems that not many people are aware of "process substitution"
> in bash: you do something like "diff <(ls dir1) <(ls dir2)", and bash
> runs two ls's, each writing to a FIFO, and diff gets the names of
> these two FIFOs as parameters. Output redirection also works. I'm not
> sure how portable it is, though.
> 


        1.
[08:05:37 /tmp]$ diff < (ls ~/setiathome/) <(ls ~/setiathome/amos/)
bash: syntax error near unexpected token `(l'
[08:06:04 /tmp]$ 

Ache, the space there is significant:

[08:17:12 /tmp]$ diff <(ls ~/setiathome/) <(ls ~/setiathome/amos/)
1,4c1
< NOTE
< README
< README.xsetiathome
< amos
---
> Release_Notes.txt
8a6
> result.sah
11c9
< setiathome-3.0.i386-pc-linux-gnu-gnulibc2.1.tar
---
> setiathome_win_3_0.exe
14a13
> windows_help.txt
16c15
< xsetiathome
---
> wtemp.sah
[08:18:20 /tmp]$ 

        2.
This will only work if the "main" process (diff in this example) does not need 
to seek the input since it can not do it with a FIFO. Or am I missing 
something?


> Does anyone else like these tricks? I'd love to hear about other
> people's.
> 
> 
>       - Adi Stav
> 
> =================================================================
> To unsubscribe, send mail to [EMAIL PROTECTED] with
> the word "unsubscribe" in the message body, e.g., run the command
> echo unsubscribe | mail [EMAIL PROTECTED]
> 

-- 
        
        Shaul Karl <[EMAIL PROTECTED]>



=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to