[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: printf -u "$fd"?
From: |
Zachary Santer |
Subject: |
Re: printf -u "$fd"? |
Date: |
Wed, 22 May 2024 08:10:20 -0400 |
On Wed, May 22, 2024 at 12:32 AM Zachary Santer <zsanter@gmail.com> wrote:
>
> In my Rocky Linux 9.1 VM:
> $ bash --version
> GNU bash, version 5.1.8(1)-release [...]
> $ exec {fd_A}> >( cat > file_A.txt )
> $ exec {fd_B}> >( cat > file_B.txt )
> $ printf 'words\n' | tee /dev/fd/"${fd_A}" /dev/fd/"${fd_B}"
> words
> $ exec {fd_A}>&- {fd_B}>&-
> $ cat file_A.txt
> words
> $ cat file_B.txt
> words
> $ exec {fd_A}> >( tr 'w' 'W' > file_A.txt )
> $ exec {fd_B}> >( tr 'w' 'W' > file_B.txt )
> $ exec {fd_A}>&- {fd_B}>&-
> $ cat file_A.txt
> $ cat file_B.txt
> $
Yes, I missed a line there, several times actually, and then pasted that here.
$ exec {fd_A}> >( cat > file_A.txt )
$ exec {fd_B}> >( cat > file_B.txt )
$ printf 'words\n' | tee /dev/fd/"${fd_A}" /dev/fd/"${fd_B}"
words
$ exec {fd_A}>&- {fd_B}>&-
$ cat file_A.txt
words
$ cat file_B.txt
words
$ exec {fd_A}> >( tr 'w' 'W' > file_A.txt )
$ exec {fd_B}> >( tr 'w' 'W' > file_B.txt )
$ printf 'words\n' | tee /dev/fd/"${fd_A}" /dev/fd/"${fd_B}"
words
$ exec {fd_A}>&- {fd_B}>&-
$ cat file_A.txt
Words
$ cat file_B.txt
Words
I should really sit on these emails more often.
- Re: printf -u "$fd"?, (continued)
- Re: printf -u "$fd"?, Kerin Millar, 2024/05/19
- Re: printf -u "$fd"?, alex xmb sw ratchev, 2024/05/19
- Re: printf -u "$fd"?, Chet Ramey, 2024/05/20
- Re: printf -u "$fd"?, Zachary Santer, 2024/05/21
- Re: printf -u "$fd"?, Chet Ramey, 2024/05/21
- Re: printf -u "$fd"?, Zachary Santer, 2024/05/21
- Re: printf -u "$fd"?, Chet Ramey, 2024/05/21
- Re: printf -u "$fd"?, Zachary Santer, 2024/05/22
- Re: printf -u "$fd"?,
Zachary Santer <=
- Re: printf -u "$fd"?, Chet Ramey, 2024/05/22
- Re: printf -u "$fd"?, Koichi Murase, 2024/05/22